diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-01-21 23:08:01 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-01-21 23:08:01 +0000 |
| commit | 1d8ef6faa2cf5d407729eb128a9f730a4800893b (patch) | |
| tree | ad7c23fd917fdd0b2674923afe4050247ddc4ae0 | |
| parent | cf05aa5ac8cd15510b1c9072fe93885022f9c78d (diff) | |
| parent | 617f6e7855dfe6f9b36840263cd3bda5c86f61e7 (diff) | |
Merge pull request #3777 from adom-inc/rp2350-watchdog-fix
fix: enable RP2350 watchdog tick generator
| -rw-r--r-- | embassy-rp/src/clocks.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs index e82beb0f1..2ac2c925e 100644 --- a/embassy-rp/src/clocks.rs +++ b/embassy-rp/src/clocks.rs | |||
| @@ -524,8 +524,13 @@ pub(crate) unsafe fn init(config: ClockConfig) { | |||
| 524 | // Configure tick generator on the 2350 | 524 | // Configure tick generator on the 2350 |
| 525 | #[cfg(feature = "_rp235x")] | 525 | #[cfg(feature = "_rp235x")] |
| 526 | { | 526 | { |
| 527 | pac::TICKS.timer0_cycles().write(|w| w.0 = clk_ref_freq / 1_000_000); | 527 | let cycle_count = clk_ref_freq / 1_000_000; |
| 528 | |||
| 529 | pac::TICKS.timer0_cycles().write(|w| w.0 = cycle_count); | ||
| 528 | pac::TICKS.timer0_ctrl().write(|w| w.set_enable(true)); | 530 | pac::TICKS.timer0_ctrl().write(|w| w.set_enable(true)); |
| 531 | |||
| 532 | pac::TICKS.watchdog_cycles().write(|w| w.0 = cycle_count); | ||
| 533 | pac::TICKS.watchdog_ctrl().write(|w| w.set_enable(true)); | ||
| 529 | } | 534 | } |
| 530 | 535 | ||
| 531 | let (sys_src, sys_aux, clk_sys_freq) = { | 536 | let (sys_src, sys_aux, clk_sys_freq) = { |
