diff options
| -rw-r--r-- | embassy-rp/src/clocks.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs index 5f7ba10e2..ed146844c 100644 --- a/embassy-rp/src/clocks.rs +++ b/embassy-rp/src/clocks.rs | |||
| @@ -512,12 +512,18 @@ pub(crate) unsafe fn init(config: ClockConfig) { | |||
| 512 | w.set_int(config.ref_clk.div); | 512 | w.set_int(config.ref_clk.div); |
| 513 | }); | 513 | }); |
| 514 | 514 | ||
| 515 | // Configure tick generation on the 2040. On the 2350 the timers are driven from the sysclk. | 515 | // Configure tick generation on the 2040. |
| 516 | #[cfg(feature = "rp2040")] | 516 | #[cfg(feature = "rp2040")] |
| 517 | pac::WATCHDOG.tick().write(|w| { | 517 | pac::WATCHDOG.tick().write(|w| { |
| 518 | w.set_cycles((clk_ref_freq / 1_000_000) as u16); | 518 | w.set_cycles((clk_ref_freq / 1_000_000) as u16); |
| 519 | w.set_enable(true); | 519 | w.set_enable(true); |
| 520 | }); | 520 | }); |
| 521 | // Configure tick generator on the 2350 | ||
| 522 | #[cfg(feature = "_rp235x")] | ||
| 523 | { | ||
| 524 | pac::TICKS.timer0_cycles().write(|w| w.0 = clk_ref_freq / 1_000_000); | ||
| 525 | pac::TICKS.timer0_ctrl().write(|w| w.set_enable(true)); | ||
| 526 | } | ||
| 521 | 527 | ||
| 522 | let (sys_src, sys_aux, clk_sys_freq) = { | 528 | let (sys_src, sys_aux, clk_sys_freq) = { |
| 523 | use {ClkSysCtrlAuxsrc as Aux, ClkSysCtrlSrc as Src}; | 529 | use {ClkSysCtrlAuxsrc as Aux, ClkSysCtrlSrc as Src}; |
