diff --git a/rp2040-hal/src/xosc.rs b/rp2040-hal/src/xosc.rs index b97724d..0d3a1f5 100644 --- a/rp2040-hal/src/xosc.rs +++ b/rp2040-hal/src/xosc.rs @@ -13,9 +13,9 @@ use embedded_time::{ rate::{ Hertz, Megahertz, + Rate }, duration::{ - Seconds, Milliseconds, Duration } @@ -106,7 +106,7 @@ impl CrystalOscillator { }); //1 ms = 10e-3 sec and Freq = 1/T where T is in seconds so 1ms converts to 1000Hz - let delay_to_hz: Hertz = STABLE_DELAY.to_rate(); + let delay_to_hz: Hertz = STABLE_DELAY.to_rate().map_err(|_|Error::BadArgument)?; //startup_delay = ((freq_hz * 10e-3) / 256) = ((freq_hz / 1000) / 256) //See Chapter 2, Section 16, ยง3)