Skip to content

Commit bbc5f3f

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

embassy-rp/src/time_driver.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use embassy_time_queue_utils::Queue;
1010
use pac::TIMER;
1111
#[cfg(feature = "_rp235x")]
1212
use pac::TIMER0 as TIMER;
13+
#[cfg(all(feature = "_rp235x", feature = "timer-src-clk-sys"))]
14+
use rp_pac::timer::vals::ClkSys;
1315

1416
use crate::interrupt::InterruptExt;
1517
use crate::{interrupt, pac};
@@ -131,8 +133,9 @@ pub unsafe fn init() {
131133
}
132134
#[cfg(all(feature = "_rp235x", feature = "timer-src-clk-sys"))]
133135
{
134-
// The PAC currently only defines `TIMER0` even though the RP2350 also has a `TIMER1`.
135-
let timer_0 = TIMER0;
136+
// The PAC currently only defines `TIMER0` as `TIMER` even though the RP2350 also has
137+
// `TIMER1`.
138+
let timer_0 = TIMER;
136139
// Switch `SOURCE` to `CLK_SYS` (instead of 1 µs tick)
137140
timer_0.source().write(|w| w.set_clk_sys(ClkSys::CLK_SYS));
138141
// Lock configuration--`TIMER0` now read-only (until reset)

0 commit comments

Comments
 (0)