diff --git a/src/runtime/src/rtio_clocking.rs b/src/runtime/src/rtio_clocking.rs index cd279da..a3e2f7b 100644 --- a/src/runtime/src/rtio_clocking.rs +++ b/src/runtime/src/rtio_clocking.rs @@ -24,8 +24,9 @@ pub enum RtioClock { } fn get_rtio_clock_cfg(cfg: &Config) -> RtioClock { + let mut res = RtioClock::Default; if let Ok(clk) = cfg.read_str("rtio_clock") { - match clk.as_ref() { + res = match clk.as_ref() { "int_125" => RtioClock::Int_125, "int_100" => RtioClock::Int_100, "int_150" => RtioClock::Int_150, @@ -37,14 +38,18 @@ fn get_rtio_clock_cfg(cfg: &Config) -> RtioClock { "ext0_synth0_125to125" => RtioClock::Ext0_Synth0_125to125, _ => { warn!("Unrecognised rtio_clock setting. Falling back to default."); - RtioClock::Int_125 + RtioClock::Default } - } + }; } else { - info!("error reading configuration. Falling back to default."); - RtioClock::Default + warn!("error reading configuration. Falling back to default."); } + if res == RtioClock::Default { + warn!("Using default configuration - internal 125MHz RTIO clock."); + return RtioClock::Int_125; + } + res }