Frequency display is now consistent

This commit is contained in:
Steven Friedman 2025-04-08 09:17:54 -04:00
parent a23e971d31
commit 3cb178e78e
No known key found for this signature in database
GPG Key ID: 58A79D6C92E57FA7
5 changed files with 5 additions and 5 deletions

View File

@ -163,7 +163,7 @@ impl<'d, T: Instance> Adc<'d, T> {
T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc())); T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc()));
let frequency = Hertz(T::frequency().0 / prescaler.divisor()); let frequency = Hertz(T::frequency().0 / prescaler.divisor());
debug!("ADC frequency set to {} Hz", frequency.0); debug!("ADC frequency set to {} Hz", frequency);
if frequency > MAX_ADC_CLK_FREQ { if frequency > MAX_ADC_CLK_FREQ {
panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 );

View File

@ -143,7 +143,7 @@ impl<'d, T: Instance> Adc<'d, T> {
T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc())); T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc()));
let frequency = Hertz(T::frequency().0 / prescaler.divisor()); let frequency = Hertz(T::frequency().0 / prescaler.divisor());
info!("ADC frequency set to {} Hz", frequency.0); info!("ADC frequency set to {} Hz", frequency);
if frequency > MAX_ADC_CLK_FREQ { if frequency > MAX_ADC_CLK_FREQ {
panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 );

View File

@ -193,7 +193,7 @@ impl<'d, T: Instance> Adc4<'d, T> {
T::regs().ccr().modify(|w| w.set_presc(prescaler.presc())); T::regs().ccr().modify(|w| w.set_presc(prescaler.presc()));
let frequency = Hertz(T::frequency().0 / prescaler.divisor()); let frequency = Hertz(T::frequency().0 / prescaler.divisor());
info!("ADC4 frequency set to {} Hz", frequency.0); info!("ADC4 frequency set to {} Hz", frequency);
if frequency > MAX_ADC_CLK_FREQ { if frequency > MAX_ADC_CLK_FREQ {
panic!("Maximal allowed frequency for ADC4 is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); panic!("Maximal allowed frequency for ADC4 is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 );

View File

@ -166,7 +166,7 @@ impl<'d, T: Instance> Adc<'d, T> {
T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc())); T::common_regs().ccr().modify(|w| w.set_presc(prescaler.presc()));
let frequency = Hertz(T::frequency().0 / prescaler.divisor()); let frequency = Hertz(T::frequency().0 / prescaler.divisor());
info!("ADC frequency set to {} Hz", frequency.0); info!("ADC frequency set to {} Hz", frequency);
if frequency > MAX_ADC_CLK_FREQ { if frequency > MAX_ADC_CLK_FREQ {
panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 ); panic!("Maximal allowed frequency for the ADC is {} MHz and it varies with different packages, refer to ST docs for more information.", MAX_ADC_CLK_FREQ.0 / 1_000_000 );

View File

@ -792,7 +792,7 @@ fn init_pll(num: usize, config: Option<Pll>, input: &PllInput) -> PllOutput {
} else if wide_allowed && VCO_WIDE_RANGE.contains(&vco_clk) { } else if wide_allowed && VCO_WIDE_RANGE.contains(&vco_clk) {
Pllvcosel::WIDE_VCO Pllvcosel::WIDE_VCO
} else { } else {
panic!("pll vco_clk out of range: {} hz", vco_clk.0) panic!("pll vco_clk out of range: {} hz", vco_clk)
}; };
let p = config.divp.map(|div| { let p = config.divp.map(|div| {