Skip to content

Commit 26db150

Browse files
committed
Use definition from new PAC
1 parent 4880400 commit 26db150

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/adc.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ macro_rules! adc_pins {
354354
}
355355

356356
adc_pins!(
357-
//0, Vref, smpr1, smp0; // Missing smp0 in PAC
357+
0, Vref, smpr1, smp0;
358358
1, gpio::PC0<Analog>, smpr1, smp1;
359359
2, gpio::PC1<Analog>, smpr1, smp2;
360360
3, gpio::PC2<Analog>, smpr1, smp3;
@@ -374,22 +374,3 @@ adc_pins!(
374374
17, Temperature, smpr2, smp17;
375375
18, Vbat, smpr2, smp18;
376376
);
377-
378-
// SMP0 is missing in PAC, manual impl for now
379-
impl EmbeddedHalChannel<ADC> for Vref {
380-
type ID = u8;
381-
382-
fn channel() -> Self::ID {
383-
0
384-
}
385-
}
386-
387-
impl Channel for Vref {
388-
fn set_sample_time(&mut self, adc: &ADC1, sample_time: SampleTime) {
389-
adc.smpr1.modify(|r, w| {
390-
// This is sound, as all `SampleTime` values are valid
391-
// for this field, and the SMP0 field is at the lowest 3 bits.
392-
unsafe { w.bits((r.bits() & !0x7) | sample_time as u32) }
393-
})
394-
}
395-
}

0 commit comments

Comments
 (0)