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:
Derek Witt 2021-08-08 23:47:50 -04:00 committed by GitHub
parent 369ac5a23f
commit a03052355e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);