Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
b0d0e292
Unverified
Commit
b0d0e292
authored
Sep 07, 2022
by
Earle F. Philhower, III
Committed by
GitHub
Sep 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor - Add number separators (#845)
parent
e2b04e74
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
cores/rp2040/PolledTimeout.h
cores/rp2040/PolledTimeout.h
+4
-4
cores/rp2040/RP2040Support.h
cores/rp2040/RP2040Support.h
+1
-1
cores/rp2040/SerialUSB.cpp
cores/rp2040/SerialUSB.cpp
+1
-1
cores/rp2040/Tone.cpp
cores/rp2040/Tone.cpp
+1
-1
cores/rp2040/posix.cpp
cores/rp2040/posix.cpp
+4
-4
cores/rp2040/wiring_analog.cpp
cores/rp2040/wiring_analog.cpp
+2
-2
No files found.
cores/rp2040/PolledTimeout.h
View file @
b0d0e292
...
...
@@ -129,10 +129,10 @@ struct TimeUnit {
}
};
using
TimeMillis
=
TimeUnit
<
TimeSourceMillis
,
1
000
>
;
using
TimeFastMillis
=
TimeUnit
<
TimeSourceCycles
,
1
000
>
;
using
TimeFastMicros
=
TimeUnit
<
TimeSourceCycles
,
1000
000
>
;
using
TimeFastNanos
=
TimeUnit
<
TimeSourceCycles
,
1000000
000
>
;
using
TimeMillis
=
TimeUnit
<
TimeSourceMillis
,
1'
000
>
;
using
TimeFastMillis
=
TimeUnit
<
TimeSourceCycles
,
1'
000
>
;
using
TimeFastMicros
=
TimeUnit
<
TimeSourceCycles
,
1'000'
000
>
;
using
TimeFastNanos
=
TimeUnit
<
TimeSourceCycles
,
1'000'000'
000
>
;
}
//TimePolicy
...
...
cores/rp2040/RP2040Support.h
View file @
b0d0e292
...
...
@@ -238,7 +238,7 @@ public:
// Convert from microseconds to PIO clock cycles
static
int
usToPIOCycles
(
int
us
)
{
// Parenthesis needed to guarantee order of operations to avoid 32bit overflow
return
(
us
*
(
clock_get_hz
(
clk_sys
)
/
1
000
000
));
return
(
us
*
(
clock_get_hz
(
clk_sys
)
/
1
'000'
000
));
}
// Get current clock frequency
...
...
cores/rp2040/SerialUSB.cpp
View file @
b0d0e292
...
...
@@ -147,7 +147,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
tud_task
();
tud_cdc_write_flush
();
if
(
!
tud_cdc_connected
()
||
(
!
tud_cdc_write_available
()
&&
time_us_64
()
>
last_avail_time
+
1
000
000
/* 1 second */
))
{
(
!
tud_cdc_write_available
()
&&
time_us_64
()
>
last_avail_time
+
1
'000'
000
/* 1 second */
))
{
break
;
}
}
...
...
cores/rp2040/Tone.cpp
View file @
b0d0e292
...
...
@@ -62,7 +62,7 @@ void tone(uint8_t pin, unsigned int frequency, unsigned long duration) {
return
;
// Weird deadlock case
}
int
us
=
1
000
000
/
frequency
/
2
;
int
us
=
1
'000'
000
/
frequency
/
2
;
if
(
us
<
5
)
{
us
=
5
;
}
...
...
cores/rp2040/posix.cpp
View file @
b0d0e292
...
...
@@ -90,8 +90,8 @@ extern "C" int _gettimeofday(struct timeval *tv, void *tz) {
(
void
)
tz
;
uint64_t
now_us
=
to_us_since_boot
(
get_absolute_time
())
+
__timedelta_us
;
if
(
tv
)
{
tv
->
tv_sec
=
now_us
/
1
000
000L
;
tv
->
tv_usec
=
now_us
%
1
000
000L
;
tv
->
tv_sec
=
now_us
/
1
'000'
000L
;
tv
->
tv_usec
=
now_us
%
1
'000'
000L
;
}
return
0
;
}
...
...
@@ -101,7 +101,7 @@ extern "C" int settimeofday(const struct timeval *tv, const struct timezone *tz)
uint64_t
now_us
=
to_us_since_boot
(
get_absolute_time
());
if
(
tv
)
{
uint64_t
newnow_us
;
newnow_us
=
tv
->
tv_sec
*
1
000
000L
;
newnow_us
=
tv
->
tv_sec
*
1
'000'
000L
;
newnow_us
+=
tv
->
tv_usec
;
__timedelta_us
=
newnow_us
-
now_us
;
}
...
...
@@ -111,7 +111,7 @@ extern "C" int settimeofday(const struct timeval *tv, const struct timezone *tz)
// For NTP
extern
"C"
void
__setSystemTime
(
unsigned
long
long
sec
,
unsigned
long
usec
)
{
uint64_t
now_us
=
to_us_since_boot
(
get_absolute_time
());
uint64_t
newnow_us
=
sec
*
1
000
000LL
+
usec
;
uint64_t
newnow_us
=
sec
*
1
'000'
000LL
+
usec
;
__timedelta_us
=
newnow_us
-
now_us
;
}
...
...
cores/rp2040/wiring_analog.cpp
View file @
b0d0e292
...
...
@@ -42,9 +42,9 @@ extern "C" void analogWriteFreq(uint32_t freq) {
if
(
freq
<
100
)
{
DEBUGCORE
(
"ERROR: analogWriteFreq too low (%d)
\n
"
,
freq
);
analogFreq
=
100
;
}
else
if
(
freq
>
1
000
000
)
{
}
else
if
(
freq
>
1
'000'
000
)
{
DEBUGCORE
(
"ERROR: analogWriteFreq too high (%d)
\n
"
,
freq
);
analogFreq
=
1
000
000
;
analogFreq
=
1
'000'
000
;
}
else
{
analogFreq
=
freq
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment