Remove PeripheralRef::into_inner()

This commit is contained in:
Dario Nieuwenhuis
2022-07-23 14:27:45 +02:00
parent a158295782
commit f02ba35482
11 changed files with 156 additions and 105 deletions

View File

@ -147,8 +147,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
timer.cc(0).short_compare_stop();
let mut ppi_ch1 = Ppi::new_one_to_two(
//TODO: Avoid into_inner?
unsafe { ppi_ch1.into_inner() }.degrade(),
ppi_ch1.map_into(),
Event::from_reg(&r.events_rxdrdy),
timer.task_clear(),
timer.task_start(),
@ -156,16 +155,14 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
ppi_ch1.enable();
let mut ppi_ch2 = Ppi::new_one_to_one(
//TODO: Avoid into_inner?
unsafe { ppi_ch2.into_inner() }.degrade(),
ppi_ch2.map_into(),
timer.cc(0).event_compare(),
Task::from_reg(&r.tasks_stoprx),
);
ppi_ch2.enable();
Self {
//TODO: Avoid into_inner?
inner: PeripheralMutex::new(unsafe { irq.into_inner() }, &mut state.0, move || StateInner {
inner: PeripheralMutex::new(irq, &mut state.0, move || StateInner {
phantom: PhantomData,
timer,
_ppi_ch1: ppi_ch1,