Remove free() from PeripheralMutex and all nrf drivers.
This commit is contained in:
@ -201,29 +201,6 @@ impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi
|
||||
fn inner(self: Pin<&mut Self>) -> Pin<&mut PeripheralMutex<State<'a, U, T, P1, P2>>> {
|
||||
unsafe { Pin::new_unchecked(&mut self.get_unchecked_mut().inner) }
|
||||
}
|
||||
|
||||
pub fn free(self: Pin<&mut Self>) -> (U, T, P1, P2, U::Interrupt) {
|
||||
let (mut state, irq) = self.inner().free();
|
||||
state.stop();
|
||||
(
|
||||
state.uarte,
|
||||
state.timer,
|
||||
state.ppi_channel_1,
|
||||
state.ppi_channel_2,
|
||||
irq,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi> Drop
|
||||
for BufferedUarte<'a, U, T, P1, P2>
|
||||
{
|
||||
fn drop(&mut self) {
|
||||
let inner = unsafe { Pin::new_unchecked(&mut self.inner) };
|
||||
if let Some((mut state, _irq)) = inner.try_free() {
|
||||
state.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi> AsyncBufRead
|
||||
@ -293,10 +270,10 @@ impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi>
|
||||
State<'a, U, T, P1, P2>
|
||||
impl<'a, U: Instance, T: TimerInstance, P1: ConfigurablePpi, P2: ConfigurablePpi> Drop
|
||||
for State<'a, U, T, P1, P2>
|
||||
{
|
||||
fn stop(&mut self) {
|
||||
fn drop(&mut self) {
|
||||
self.timer.tasks_stop.write(|w| unsafe { w.bits(1) });
|
||||
if let RxState::Receiving = self.rx_state {
|
||||
self.uarte.tasks_stoprx.write(|w| unsafe { w.bits(1) });
|
||||
|
@ -238,11 +238,6 @@ impl Qspi {
|
||||
unsafe { Pin::new_unchecked(&mut self.get_unchecked_mut().inner) }
|
||||
}
|
||||
|
||||
pub fn free(self: Pin<&mut Self>) -> (QSPI, interrupt::QSPI) {
|
||||
let (state, irq) = self.inner().free();
|
||||
(state.inner, irq)
|
||||
}
|
||||
|
||||
fn wait_ready<'a>(mut self: Pin<&'a mut Self>) -> impl Future<Output = ()> + 'a {
|
||||
poll_fn(move |cx| {
|
||||
self.as_mut().inner().with(|s, _irq| {
|
||||
|
@ -120,11 +120,6 @@ impl<T: Instance> Spim<T> {
|
||||
fn inner(self: Pin<&mut Self>) -> Pin<&mut PeripheralMutex<State<T>>> {
|
||||
unsafe { Pin::new_unchecked(&mut self.get_unchecked_mut().inner) }
|
||||
}
|
||||
|
||||
pub fn free(self: Pin<&mut Self>) -> (T, T::Interrupt) {
|
||||
let (state, irq) = self.inner().free();
|
||||
(state.spim, irq)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Instance> FullDuplex<u8> for Spim<T> {
|
||||
|
Reference in New Issue
Block a user