From fea35b48bbfae75812dc7ab0ee78a70ffbc42985 Mon Sep 17 00:00:00 2001 From: camrbuss Date: Sun, 21 Aug 2022 02:51:53 -0400 Subject: [PATCH] doc: fix clocks extended usage xosc order --- rp2040-hal/src/clocks/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rp2040-hal/src/clocks/mod.rs b/rp2040-hal/src/clocks/mod.rs index 19f04aa..5465647 100644 --- a/rp2040-hal/src/clocks/mod.rs +++ b/rp2040-hal/src/clocks/mod.rs @@ -22,13 +22,14 @@ //! let mut watchdog = Watchdog::new(peripherals.WATCHDOG); //! const XOSC_CRYSTAL_FREQ: u32 = 12_000_000; // Typically found in BSP crates //! -//! // Start tick in watchdog -//! watchdog.enable_tick_generation(XOSC_CRYSTAL_FREQ as u8); -//! -//! let mut clocks = ClocksManager::new(peripherals.CLOCKS); //! // Enable the xosc //! let xosc = setup_xosc_blocking(peripherals.XOSC, XOSC_CRYSTAL_FREQ.Hz()).map_err(InitError::XoscErr)?; //! +//! // Start tick in watchdog +//! watchdog.enable_tick_generation((XOSC_CRYSTAL_FREQ / 1_000_000) as u8); +//! +//! let mut clocks = ClocksManager::new(peripherals.CLOCKS); +//! //! // Configure PLLs //! // REF FBDIV VCO POSTDIV //! // PLL SYS: 12 / 1 = 12MHz * 125 = 1500MHZ / 6 / 2 = 125MHz