aboutsummaryrefslogtreecommitdiff
path: root/embassy-cortex-m/src/peripheral.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
commit4901c34d9c4cd326ab9bca02dd099a663da2567f (patch)
tree8225afebb595fb10c1d67148c0d19b7b732853da /embassy-cortex-m/src/peripheral.rs
parent8a9d2f59af004902d3978a2922843833b98bcce0 (diff)
Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral
Diffstat (limited to 'embassy-cortex-m/src/peripheral.rs')
-rw-r--r--embassy-cortex-m/src/peripheral.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-cortex-m/src/peripheral.rs b/embassy-cortex-m/src/peripheral.rs
index c5fa20e71..e2f295579 100644
--- a/embassy-cortex-m/src/peripheral.rs
+++ b/embassy-cortex-m/src/peripheral.rs
@@ -3,7 +3,7 @@ use core::mem::MaybeUninit;
3 3
4use cortex_m::peripheral::scb::VectActive; 4use cortex_m::peripheral::scb::VectActive;
5use cortex_m::peripheral::{NVIC, SCB}; 5use cortex_m::peripheral::{NVIC, SCB};
6use embassy_hal_common::{unborrow, Unborrow, Unborrowed}; 6use embassy_hal_common::{into_ref, Peripheral, PeripheralRef};
7 7
8use crate::interrupt::{Interrupt, InterruptExt, Priority}; 8use crate::interrupt::{Interrupt, InterruptExt, Priority};
9 9
@@ -33,7 +33,7 @@ impl<S> StateStorage<S> {
33/// a safe way. 33/// a safe way.
34pub struct PeripheralMutex<'a, S: PeripheralState> { 34pub struct PeripheralMutex<'a, S: PeripheralState> {
35 state: *mut S, 35 state: *mut S,
36 irq: Unborrowed<'a, S::Interrupt>, 36 irq: PeripheralRef<'a, S::Interrupt>,
37} 37}
38 38
39/// Whether `irq` can be preempted by the current interrupt. 39/// Whether `irq` can be preempted by the current interrupt.
@@ -62,11 +62,11 @@ impl<'a, S: PeripheralState> PeripheralMutex<'a, S> {
62 /// 62 ///
63 /// Registers `on_interrupt` as the `irq`'s handler, and enables it. 63 /// Registers `on_interrupt` as the `irq`'s handler, and enables it.
64 pub fn new( 64 pub fn new(
65 irq: impl Unborrow<Target = S::Interrupt> + 'a, 65 irq: impl Peripheral<P = S::Interrupt> + 'a,
66 storage: &'a mut StateStorage<S>, 66 storage: &'a mut StateStorage<S>,
67 init: impl FnOnce() -> S, 67 init: impl FnOnce() -> S,
68 ) -> Self { 68 ) -> Self {
69 unborrow!(irq); 69 into_ref!(irq);
70 70
71 if can_be_preempted(&*irq) { 71 if can_be_preempted(&*irq) {
72 panic!( 72 panic!(