From f69e8459c9a2362165df9dd603adb0ec6531d383 Mon Sep 17 00:00:00 2001 From: Michael van Niekerk Date: Wed, 30 Aug 2023 21:52:03 +0200 Subject: [PATCH] RP2040: Fixes as per PR --- embassy-rp/src/clocks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs index 55a18cf60..c9b2190c5 100644 --- a/embassy-rp/src/clocks.rs +++ b/embassy-rp/src/clocks.rs @@ -94,7 +94,7 @@ impl ClockConfig { post_div1: 6, post_div2: 5, }), - delay_multiplier: 1, + delay_multiplier: 128, }), ref_clk: RefClkConfig { src: RefClkSrc::Xosc, @@ -631,7 +631,7 @@ fn start_xosc(crystal_hz: u32, delay_multiplier: u32) { .ctrl() .write(|w| w.set_freq_range(pac::xosc::vals::CtrlFreqRange::_1_15MHZ)); - let startup_delay = (((crystal_hz / 1000) + 128) * delay_multiplier) / 256; + let startup_delay = ((crystal_hz / 1000 + delay_multiplier) + 128) / 256; pac::XOSC.startup().write(|w| w.set_delay(startup_delay as u16)); pac::XOSC.ctrl().write(|w| { w.set_freq_range(pac::xosc::vals::CtrlFreqRange::_1_15MHZ);