diff --git a/src/scu/ccu.rs b/src/scu/ccu.rs index 2dfe472..66ac875 100644 --- a/src/scu/ccu.rs +++ b/src/scu/ccu.rs @@ -596,10 +596,10 @@ const SYSCLK_FREQUENCY: u32 = 20_000_000; #[inline] pub(crate) fn get_osc_frequency() -> f32 { // SAFETY: each bit of SYSPLLCON0 is at least R, except for bit RESLD (W, if read always return 0) - let f = match unsafe { SCU.syspllcon0().read() }.insel().get() { - scu::syspllcon0::Insel::CONST_00 => EVR_OSC_FREQUENCY, - scu::syspllcon0::Insel::CONST_11 => XTAL_FREQUENCY, - scu::syspllcon0::Insel::CONST_22 => SYSCLK_FREQUENCY, + let f = match unsafe { SCU.syspllcon0().read() }.insel().get().0 { + 0 => EVR_OSC_FREQUENCY, + 1 => XTAL_FREQUENCY, + 2 => SYSCLK_FREQUENCY, _ => 0, }; f as f32