mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Correctly configure watchdog tick generation (#78)
Fix: The divider for watchdog tick generation is now being set to the source clock frequency in MHz, instead of the clock frequency in Hz. Watchdog ticks will now be generated at 1 microsecond intervals as intended.
This commit is contained in:
parent
369ac5a23f
commit
a03052355e
|
@ -316,8 +316,8 @@ pub fn init_clocks_and_plls(
|
|||
) -> Result<ClocksManager, InitError> {
|
||||
let xosc = setup_xosc_blocking(xosc_dev, xosc_crystal_freq.Hz()).map_err(InitError::XoscErr)?;
|
||||
|
||||
// Start tick in watchdog
|
||||
watchdog.enable_tick_generation(xosc_crystal_freq as u8);
|
||||
// Configure watchdog tick generation to tick over every microsecond
|
||||
watchdog.enable_tick_generation((xosc_crystal_freq / 1_000_000) as u8);
|
||||
|
||||
let mut clocks = ClocksManager::new(clocks_dev);
|
||||
|
||||
|
|
Loading…
Reference in a new issue