Skip to content

Commit b0d0e29

Browse files
Minor - Add number separators (earlephilhower#845)
1 parent e2b04e7 commit b0d0e29

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

cores/rp2040/PolledTimeout.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ struct TimeUnit {
129129
}
130130
};
131131

132-
using TimeMillis = TimeUnit< TimeSourceMillis, 1000 >;
133-
using TimeFastMillis = TimeUnit< TimeSourceCycles, 1000 >;
134-
using TimeFastMicros = TimeUnit< TimeSourceCycles, 1000000 >;
135-
using TimeFastNanos = TimeUnit< TimeSourceCycles, 1000000000 >;
132+
using TimeMillis = TimeUnit < TimeSourceMillis, 1'000 >;
133+
using TimeFastMillis = TimeUnit < TimeSourceCycles, 1'000 >;
134+
using TimeFastMicros = TimeUnit < TimeSourceCycles, 1'000'000 >;
135+
using TimeFastNanos = TimeUnit < TimeSourceCycles, 1'000'000'000 >;
136136

137137
} //TimePolicy
138138

cores/rp2040/RP2040Support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class RP2040 {
238238
// Convert from microseconds to PIO clock cycles
239239
static int usToPIOCycles(int us) {
240240
// Parenthesis needed to guarantee order of operations to avoid 32bit overflow
241-
return (us * (clock_get_hz(clk_sys) / 1000000));
241+
return (us * (clock_get_hz(clk_sys) / 1'000'000));
242242
}
243243

244244
// Get current clock frequency

cores/rp2040/SerialUSB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
147147
tud_task();
148148
tud_cdc_write_flush();
149149
if (!tud_cdc_connected() ||
150-
(!tud_cdc_write_available() && time_us_64() > last_avail_time + 1000000 /* 1 second */)) {
150+
(!tud_cdc_write_available() && time_us_64() > last_avail_time + 1'000'000 /* 1 second */)) {
151151
break;
152152
}
153153
}

cores/rp2040/Tone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void tone(uint8_t pin, unsigned int frequency, unsigned long duration) {
6262
return; // Weird deadlock case
6363
}
6464

65-
int us = 1000000 / frequency / 2;
65+
int us = 1'000'000 / frequency / 2;
6666
if (us < 5) {
6767
us = 5;
6868
}

cores/rp2040/posix.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ extern "C" int _gettimeofday(struct timeval *tv, void *tz) {
9090
(void) tz;
9191
uint64_t now_us = to_us_since_boot(get_absolute_time()) + __timedelta_us;
9292
if (tv) {
93-
tv->tv_sec = now_us / 1000000L;
94-
tv->tv_usec = now_us % 1000000L;
93+
tv->tv_sec = now_us / 1'000'000L;
94+
tv->tv_usec = now_us % 1'000'000L;
9595
}
9696
return 0;
9797
}
@@ -101,7 +101,7 @@ extern "C" int settimeofday(const struct timeval *tv, const struct timezone *tz)
101101
uint64_t now_us = to_us_since_boot(get_absolute_time());
102102
if (tv) {
103103
uint64_t newnow_us;
104-
newnow_us = tv->tv_sec * 1000000L;
104+
newnow_us = tv->tv_sec * 1'000'000L;
105105
newnow_us += tv->tv_usec;
106106
__timedelta_us = newnow_us - now_us;
107107
}
@@ -111,7 +111,7 @@ extern "C" int settimeofday(const struct timeval *tv, const struct timezone *tz)
111111
// For NTP
112112
extern "C" void __setSystemTime(unsigned long long sec, unsigned long usec) {
113113
uint64_t now_us = to_us_since_boot(get_absolute_time());
114-
uint64_t newnow_us = sec * 1000000LL + usec;
114+
uint64_t newnow_us = sec * 1'000'000LL + usec;
115115
__timedelta_us = newnow_us - now_us;
116116
}
117117

cores/rp2040/wiring_analog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ extern "C" void analogWriteFreq(uint32_t freq) {
4242
if (freq < 100) {
4343
DEBUGCORE("ERROR: analogWriteFreq too low (%d)\n", freq);
4444
analogFreq = 100;
45-
} else if (freq > 1000000) {
45+
} else if (freq > 1'000'000) {
4646
DEBUGCORE("ERROR: analogWriteFreq too high (%d)\n", freq);
47-
analogFreq = 1000000;
47+
analogFreq = 1'000'000;
4848
} else {
4949
analogFreq = freq;
5050
}

0 commit comments

Comments
 (0)