mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-26 03:06:32 +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
1 changed files with 2 additions and 2 deletions
|
@ -316,8 +316,8 @@ pub fn init_clocks_and_plls(
|
||||||
) -> Result<ClocksManager, InitError> {
|
) -> Result<ClocksManager, InitError> {
|
||||||
let xosc = setup_xosc_blocking(xosc_dev, xosc_crystal_freq.Hz()).map_err(InitError::XoscErr)?;
|
let xosc = setup_xosc_blocking(xosc_dev, xosc_crystal_freq.Hz()).map_err(InitError::XoscErr)?;
|
||||||
|
|
||||||
// Start tick in watchdog
|
// Configure watchdog tick generation to tick over every microsecond
|
||||||
watchdog.enable_tick_generation(xosc_crystal_freq as u8);
|
watchdog.enable_tick_generation((xosc_crystal_freq / 1_000_000) as u8);
|
||||||
|
|
||||||
let mut clocks = ClocksManager::new(clocks_dev);
|
let mut clocks = ClocksManager::new(clocks_dev);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue