rtio_clocking: add warnings for unsupported rtio_clock settings (#1773)

This commit is contained in:
Spaqin 2021-10-28 16:34:22 +08:00 committed by GitHub
parent 9b1d7e297d
commit 69cddc6b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 3 deletions

View File

@ -83,9 +83,13 @@ pub mod crg {
info!("Using external clock"); info!("Using external clock");
1 1
}, },
_ => { RtioClock::Int_125 => {
info!("Using internal RTIO clock"); info!("Using internal RTIO clock");
0 0
},
_ => {
warn!("rtio_clock setting '{:?}' is not supported. Using default internal RTIO clock instead", clk);
0
} }
}; };
unsafe { unsafe {
@ -181,8 +185,21 @@ fn setup_si5324_as_synthesizer(cfg: RtioClock) {
crystal_ref: true crystal_ref: true
} }
}, },
_ => { // 125MHz output, from crystal, 7 Hz, default (if chosen option is not supported) RtioClock::Int_125 => { // 125MHz output, from crystal, 7 Hz
info!("using internal 125MHz RTIO clock"); // covers also RtioClock::Int_125 info!("using internal 125MHz RTIO clock");
si5324::FrequencySettings {
n1_hs : 10,
nc1_ls : 4,
n2_hs : 10,
n2_ls : 19972,
n31 : 4565,
n32 : 4565,
bwsel : 4,
crystal_ref: true
}
}
_ => { // 125MHz output like above, default (if chosen option is not supported)
warn!("rtio_clock setting '{:?}' is not supported. Falling back to default internal 125MHz RTIO clock.", cfg);
si5324::FrequencySettings { si5324::FrequencySettings {
n1_hs : 10, n1_hs : 10,
nc1_ls : 4, nc1_ls : 4,