Skip to content

Commit c4ef628

Browse files
committed
configure & lock TIMER0's source to CLK_SYS when timer-src-clk-sys feature is selected
1 parent 0f1d9fc commit c4ef628

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

embassy-rp/src/time_driver.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
66
use embassy_sync::blocking_mutex::Mutex;
77
use embassy_time_driver::Driver;
88
use embassy_time_queue_utils::Queue;
9+
#[cfg(all(feature = "_rp235x", feature = "timer-src-clk-sys"))]
10+
use rp_pac::timer::vals::ClkSys;
11+
912
#[cfg(feature = "rp2040")]
1013
use pac::TIMER;
1114
#[cfg(feature = "_rp235x")]
@@ -131,8 +134,9 @@ pub unsafe fn init() {
131134
}
132135
#[cfg(all(feature = "_rp235x", feature = "timer-src-clk-sys"))]
133136
{
134-
// The PAC currently only defines `TIMER0` even though the RP2350 also has a `TIMER1`.
135-
let timer_0 = TIMER0;
137+
// The PAC currently only defines `TIMER0` as `TIMER` even though the RP2350 also has
138+
// `TIMER1`.
139+
let timer_0 = TIMER;
136140
// Switch `SOURCE` to `CLK_SYS` (instead of 1 µs tick)
137141
timer_0.source().write(|w| w.set_clk_sys(ClkSys::CLK_SYS));
138142
// Lock configuration--`TIMER0` now read-only (until reset)

0 commit comments

Comments
 (0)