removing deprecated unsafe blocks from adc
@@ -471,14 +471,11 @@ macro_rules! adc12_hal {
impl Adc<$ADC> {
fn enable_clock(&self, ahb: &mut AHB, adc_common: &mut ADC1_2) {
ahb.enr().modify(|_, w| w.adc12en().enabled());
- // NOTE(unsafe): Use only predefined, valid values.
- unsafe {
adc_common.ccr.modify(|_, w| w
.ckmode().bits(self.prescale.bitcode())
);
}
}
- }
adc_hal! {
$ADC: ($adcx, ADC1_2),
}
@@ -503,14 +500,11 @@ macro_rules! adc34_hal {
impl Adc<$ADC> {
fn enable_clock(&self, ahb: &mut AHB, adc_common: &mut ADC3_4) {
ahb.enr().modify(|_, w| w.adc34en().enabled());
- // NOTE(unsafe): Use only predefined, valid values.
- unsafe {
adc_common.ccr.modify(|_, w| w
.ckmode().bits(self.prescale.bitcode())
);
}
}
- }
adc_hal! {
$ADC: ($adcx, ADC3_4),
}
