aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-04-14 19:59:52 +0200
committerDario Nieuwenhuis <[email protected]>2021-04-14 19:59:52 +0200
commit97ca54fa6639371e5a871bd1e87562c126d92a16 (patch)
tree2cd2a7cf890817da28831af608473852c9df15e9
parentbac53e3e55e84fc2f3c1b4be8cf20d0e5f25ca22 (diff)
Rename PeripheralBorrow to Unborrow
-rw-r--r--embassy-extras/src/macros.rs8
-rw-r--r--embassy-macros/src/lib.rs4
-rw-r--r--embassy-nrf/src/buffered_uarte.rs20
-rw-r--r--embassy-nrf/src/gpio.rs6
-rw-r--r--embassy-nrf/src/ppi.rs4
-rw-r--r--embassy-nrf/src/qspi.rs18
-rw-r--r--embassy-nrf/src/saadc.rs15
-rw-r--r--embassy-nrf/src/spim.rs12
-rw-r--r--embassy-nrf/src/uarte.rs14
-rw-r--r--embassy-rp/src/gpio.rs6
-rw-r--r--embassy-rp/src/uart.rs12
-rw-r--r--embassy/src/util/mod.rs6
12 files changed, 61 insertions, 64 deletions
diff --git a/embassy-extras/src/macros.rs b/embassy-extras/src/macros.rs
index 832e76d68..d85439358 100644
--- a/embassy-extras/src/macros.rs
+++ b/embassy-extras/src/macros.rs
@@ -16,7 +16,7 @@ macro_rules! peripherals {
16 } 16 }
17 17
18 $(#[$cfg])? 18 $(#[$cfg])?
19 impl embassy::util::PeripheralBorrow for $name { 19 impl embassy::util::Unborrow for $name {
20 type Target = $name; 20 type Target = $name;
21 #[inline] 21 #[inline]
22 unsafe fn unborrow(self) -> $name { 22 unsafe fn unborrow(self) -> $name {
@@ -25,7 +25,7 @@ macro_rules! peripherals {
25 } 25 }
26 26
27 $(#[$cfg])? 27 $(#[$cfg])?
28 impl embassy::util::PeripheralBorrow for &mut $name { 28 impl embassy::util::Unborrow for &mut $name {
29 type Target = $name; 29 type Target = $name;
30 #[inline] 30 #[inline]
31 unsafe fn unborrow(self) -> $name { 31 unsafe fn unborrow(self) -> $name {
@@ -89,7 +89,7 @@ macro_rules! unborrow {
89#[macro_export] 89#[macro_export]
90macro_rules! impl_unborrow { 90macro_rules! impl_unborrow {
91 ($type:ident) => { 91 ($type:ident) => {
92 impl ::embassy::util::PeripheralBorrow for $type { 92 impl ::embassy::util::Unborrow for $type {
93 type Target = $type; 93 type Target = $type;
94 #[inline] 94 #[inline]
95 unsafe fn unborrow(self) -> Self::Target { 95 unsafe fn unborrow(self) -> Self::Target {
@@ -97,7 +97,7 @@ macro_rules! impl_unborrow {
97 } 97 }
98 } 98 }
99 99
100 impl<'a> ::embassy::util::PeripheralBorrow for &'a mut $type { 100 impl<'a> ::embassy::util::Unborrow for &'a mut $type {
101 type Target = $type; 101 type Target = $type;
102 #[inline] 102 #[inline]
103 unsafe fn unborrow(self) -> Self::Target { 103 unsafe fn unborrow(self) -> Self::Target {
diff --git a/embassy-macros/src/lib.rs b/embassy-macros/src/lib.rs
index 402f0e08a..cca6c8a56 100644
--- a/embassy-macros/src/lib.rs
+++ b/embassy-macros/src/lib.rs
@@ -147,14 +147,14 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
147 } 147 }
148 } 148 }
149 149
150 impl ::embassy::util::PeripheralBorrow for #name_interrupt { 150 impl ::embassy::util::Unborrow for #name_interrupt {
151 type Target = #name_interrupt; 151 type Target = #name_interrupt;
152 unsafe fn unborrow(self) -> #name_interrupt { 152 unsafe fn unborrow(self) -> #name_interrupt {
153 self 153 self
154 } 154 }
155 } 155 }
156 156
157 impl ::embassy::util::PeripheralBorrow for &mut #name_interrupt { 157 impl ::embassy::util::Unborrow for &mut #name_interrupt {
158 type Target = #name_interrupt; 158 type Target = #name_interrupt;
159 unsafe fn unborrow(self) -> #name_interrupt { 159 unsafe fn unborrow(self) -> #name_interrupt {
160 ::core::ptr::read(self) 160 ::core::ptr::read(self)
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs
index 9e67aaef6..49e8dd2b6 100644
--- a/embassy-nrf/src/buffered_uarte.rs
+++ b/embassy-nrf/src/buffered_uarte.rs
@@ -5,7 +5,7 @@ use core::sync::atomic::{compiler_fence, Ordering};
5use core::task::{Context, Poll}; 5use core::task::{Context, Poll};
6use embassy::interrupt::InterruptExt; 6use embassy::interrupt::InterruptExt;
7use embassy::io::{AsyncBufRead, AsyncWrite, Result}; 7use embassy::io::{AsyncBufRead, AsyncWrite, Result};
8use embassy::util::{PeripheralBorrow, WakerRegistration}; 8use embassy::util::{Unborrow, WakerRegistration};
9use embassy_extras::peripheral::{PeripheralMutex, PeripheralState}; 9use embassy_extras::peripheral::{PeripheralMutex, PeripheralState};
10use embassy_extras::ring_buffer::RingBuffer; 10use embassy_extras::ring_buffer::RingBuffer;
11use embassy_extras::{low_power_wait_until, unborrow}; 11use embassy_extras::{low_power_wait_until, unborrow};
@@ -63,15 +63,15 @@ pub struct BufferedUarte<'d, U: UarteInstance, T: TimerInstance> {
63impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { 63impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
64 /// unsafe: may not leak self or futures 64 /// unsafe: may not leak self or futures
65 pub unsafe fn new( 65 pub unsafe fn new(
66 uarte: impl PeripheralBorrow<Target = U> + 'd, 66 uarte: impl Unborrow<Target = U> + 'd,
67 timer: impl PeripheralBorrow<Target = T> + 'd, 67 timer: impl Unborrow<Target = T> + 'd,
68 ppi_ch1: impl PeripheralBorrow<Target = impl ConfigurableChannel> + 'd, 68 ppi_ch1: impl Unborrow<Target = impl ConfigurableChannel> + 'd,
69 ppi_ch2: impl PeripheralBorrow<Target = impl ConfigurableChannel> + 'd, 69 ppi_ch2: impl Unborrow<Target = impl ConfigurableChannel> + 'd,
70 irq: impl PeripheralBorrow<Target = U::Interrupt> + 'd, 70 irq: impl Unborrow<Target = U::Interrupt> + 'd,
71 rxd: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 71 rxd: impl Unborrow<Target = impl GpioPin> + 'd,
72 txd: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 72 txd: impl Unborrow<Target = impl GpioPin> + 'd,
73 cts: impl PeripheralBorrow<Target = impl GpioOptionalPin> + 'd, 73 cts: impl Unborrow<Target = impl GpioOptionalPin> + 'd,
74 rts: impl PeripheralBorrow<Target = impl GpioOptionalPin> + 'd, 74 rts: impl Unborrow<Target = impl GpioOptionalPin> + 'd,
75 config: Config, 75 config: Config,
76 rx_buffer: &'d mut [u8], 76 rx_buffer: &'d mut [u8],
77 tx_buffer: &'d mut [u8], 77 tx_buffer: &'d mut [u8],
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs
index 5a5f7b8da..a06ee6053 100644
--- a/embassy-nrf/src/gpio.rs
+++ b/embassy-nrf/src/gpio.rs
@@ -2,7 +2,7 @@ use core::convert::Infallible;
2use core::hint::unreachable_unchecked; 2use core::hint::unreachable_unchecked;
3use core::marker::PhantomData; 3use core::marker::PhantomData;
4 4
5use embassy::util::PeripheralBorrow; 5use embassy::util::Unborrow;
6use embassy_extras::{impl_unborrow, unborrow}; 6use embassy_extras::{impl_unborrow, unborrow};
7use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin}; 7use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
8use gpio::pin_cnf::DRIVE_A; 8use gpio::pin_cnf::DRIVE_A;
@@ -38,7 +38,7 @@ pub struct Input<'d, T: Pin> {
38} 38}
39 39
40impl<'d, T: Pin> Input<'d, T> { 40impl<'d, T: Pin> Input<'d, T> {
41 pub fn new(pin: impl PeripheralBorrow<Target = T> + 'd, pull: Pull) -> Self { 41 pub fn new(pin: impl Unborrow<Target = T> + 'd, pull: Pull) -> Self {
42 unborrow!(pin); 42 unborrow!(pin);
43 43
44 pin.conf().write(|w| { 44 pin.conf().write(|w| {
@@ -123,7 +123,7 @@ pub struct Output<'d, T: Pin> {
123 123
124impl<'d, T: Pin> Output<'d, T> { 124impl<'d, T: Pin> Output<'d, T> {
125 pub fn new( 125 pub fn new(
126 pin: impl PeripheralBorrow<Target = T> + 'd, 126 pin: impl Unborrow<Target = T> + 'd,
127 initial_output: Level, 127 initial_output: Level,
128 drive: OutputDrive, 128 drive: OutputDrive,
129 ) -> Self { 129 ) -> Self {
diff --git a/embassy-nrf/src/ppi.rs b/embassy-nrf/src/ppi.rs
index 6487267da..e8bcbd603 100644
--- a/embassy-nrf/src/ppi.rs
+++ b/embassy-nrf/src/ppi.rs
@@ -11,7 +11,7 @@
11 11
12use core::marker::PhantomData; 12use core::marker::PhantomData;
13use core::ptr::NonNull; 13use core::ptr::NonNull;
14use embassy::util::PeripheralBorrow; 14use embassy::util::Unborrow;
15use embassy_extras::{impl_unborrow, unborrow}; 15use embassy_extras::{impl_unborrow, unborrow};
16 16
17use crate::{pac, peripherals}; 17use crate::{pac, peripherals};
@@ -25,7 +25,7 @@ pub struct Ppi<'d, C: Channel> {
25} 25}
26 26
27impl<'d, C: Channel> Ppi<'d, C> { 27impl<'d, C: Channel> Ppi<'d, C> {
28 pub fn new(ch: impl PeripheralBorrow<Target = C> + 'd) -> Self { 28 pub fn new(ch: impl Unborrow<Target = C> + 'd) -> Self {
29 unborrow!(ch); 29 unborrow!(ch);
30 let mut this = Self { 30 let mut this = Self {
31 ch, 31 ch,
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs
index d682c1b8c..f683138d6 100644
--- a/embassy-nrf/src/qspi.rs
+++ b/embassy-nrf/src/qspi.rs
@@ -3,7 +3,7 @@ use core::marker::PhantomData;
3use core::task::Poll; 3use core::task::Poll;
4use embassy::interrupt::{Interrupt, InterruptExt}; 4use embassy::interrupt::{Interrupt, InterruptExt};
5use embassy::traits::flash::{Error, Flash}; 5use embassy::traits::flash::{Error, Flash};
6use embassy::util::{AtomicWaker, DropBomb, PeripheralBorrow}; 6use embassy::util::{AtomicWaker, DropBomb, Unborrow};
7use embassy_extras::unborrow; 7use embassy_extras::unborrow;
8use futures::future::poll_fn; 8use futures::future::poll_fn;
9 9
@@ -61,14 +61,14 @@ pub struct Qspi<'d, T: Instance> {
61 61
62impl<'d, T: Instance> Qspi<'d, T> { 62impl<'d, T: Instance> Qspi<'d, T> {
63 pub fn new( 63 pub fn new(
64 qspi: impl PeripheralBorrow<Target = T> + 'd, 64 qspi: impl Unborrow<Target = T> + 'd,
65 irq: impl PeripheralBorrow<Target = T::Interrupt> + 'd, 65 irq: impl Unborrow<Target = T::Interrupt> + 'd,
66 sck: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 66 sck: impl Unborrow<Target = impl GpioPin> + 'd,
67 csn: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 67 csn: impl Unborrow<Target = impl GpioPin> + 'd,
68 io0: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 68 io0: impl Unborrow<Target = impl GpioPin> + 'd,
69 io1: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 69 io1: impl Unborrow<Target = impl GpioPin> + 'd,
70 io2: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 70 io2: impl Unborrow<Target = impl GpioPin> + 'd,
71 io3: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 71 io3: impl Unborrow<Target = impl GpioPin> + 'd,
72 config: Config, 72 config: Config,
73 ) -> Self { 73 ) -> Self {
74 unborrow!(qspi, irq, sck, csn, io0, io1, io2, io3); 74 unborrow!(qspi, irq, sck, csn, io0, io1, io2, io3);
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs
index b854ce780..448d0334c 100644
--- a/embassy-nrf/src/saadc.rs
+++ b/embassy-nrf/src/saadc.rs
@@ -3,15 +3,12 @@ use core::marker::PhantomData;
3use core::pin::Pin; 3use core::pin::Pin;
4use core::sync::atomic::{compiler_fence, Ordering}; 4use core::sync::atomic::{compiler_fence, Ordering};
5use core::task::Poll; 5use core::task::Poll;
6use embassy::traits; 6use embassy::util::{wake_on_interrupt, Unborrow};
7use embassy::util::{wake_on_interrupt, PeripheralBorrow};
8use embassy_extras::unborrow; 7use embassy_extras::unborrow;
9use futures::future::poll_fn; 8use futures::future::poll_fn;
10use traits::spi::FullDuplex;
11 9
12use crate::gpio::Pin as GpioPin; 10use crate::interrupt;
13use crate::interrupt::{self, Interrupt}; 11use crate::{pac, peripherals};
14use crate::{pac, peripherals, slice_in_ram_or};
15 12
16#[cfg(feature = "9160")] 13#[cfg(feature = "9160")]
17use pac::{saadc_ns as saadc, SAADC_NS as SAADC}; 14use pac::{saadc_ns as saadc, SAADC_NS as SAADC};
@@ -74,9 +71,9 @@ impl Default for Config {
74 71
75impl<'d, T: PositivePin> OneShot<'d, T> { 72impl<'d, T: PositivePin> OneShot<'d, T> {
76 pub fn new( 73 pub fn new(
77 saadc: impl PeripheralBorrow<Target = peripherals::SAADC> + 'd, 74 saadc: impl Unborrow<Target = peripherals::SAADC> + 'd,
78 irq: impl PeripheralBorrow<Target = interrupt::SAADC> + 'd, 75 irq: impl Unborrow<Target = interrupt::SAADC> + 'd,
79 positive_pin: impl PeripheralBorrow<Target = T> + 'd, 76 positive_pin: impl Unborrow<Target = T> + 'd,
80 config: Config, 77 config: Config,
81 ) -> Self { 78 ) -> Self {
82 unborrow!(saadc, irq, positive_pin); 79 unborrow!(saadc, irq, positive_pin);
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs
index bbe1eedf9..d6b9ee8d8 100644
--- a/embassy-nrf/src/spim.rs
+++ b/embassy-nrf/src/spim.rs
@@ -4,7 +4,7 @@ use core::sync::atomic::{compiler_fence, Ordering};
4use core::task::Poll; 4use core::task::Poll;
5use embassy::interrupt::InterruptExt; 5use embassy::interrupt::InterruptExt;
6use embassy::traits; 6use embassy::traits;
7use embassy::util::{AtomicWaker, PeripheralBorrow}; 7use embassy::util::{AtomicWaker, Unborrow};
8use embassy_extras::unborrow; 8use embassy_extras::unborrow;
9use futures::future::poll_fn; 9use futures::future::poll_fn;
10use traits::spi::FullDuplex; 10use traits::spi::FullDuplex;
@@ -41,11 +41,11 @@ pub struct Config {
41 41
42impl<'d, T: Instance> Spim<'d, T> { 42impl<'d, T: Instance> Spim<'d, T> {
43 pub fn new( 43 pub fn new(
44 spim: impl PeripheralBorrow<Target = T> + 'd, 44 spim: impl Unborrow<Target = T> + 'd,
45 irq: impl PeripheralBorrow<Target = T::Interrupt> + 'd, 45 irq: impl Unborrow<Target = T::Interrupt> + 'd,
46 sck: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 46 sck: impl Unborrow<Target = impl GpioPin> + 'd,
47 miso: impl PeripheralBorrow<Target = impl OptionalPin> + 'd, 47 miso: impl Unborrow<Target = impl OptionalPin> + 'd,
48 mosi: impl PeripheralBorrow<Target = impl OptionalPin> + 'd, 48 mosi: impl Unborrow<Target = impl OptionalPin> + 'd,
49 config: Config, 49 config: Config,
50 ) -> Self { 50 ) -> Self {
51 unborrow!(spim, irq, sck, miso, mosi); 51 unborrow!(spim, irq, sck, miso, mosi);
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 9e485907c..a02f7c347 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -6,7 +6,7 @@ use core::sync::atomic::{compiler_fence, Ordering};
6use core::task::Poll; 6use core::task::Poll;
7use embassy::interrupt::InterruptExt; 7use embassy::interrupt::InterruptExt;
8use embassy::traits::uart::{Error, Read, Write}; 8use embassy::traits::uart::{Error, Read, Write};
9use embassy::util::{AtomicWaker, OnDrop, PeripheralBorrow}; 9use embassy::util::{AtomicWaker, OnDrop, Unborrow};
10use embassy_extras::unborrow; 10use embassy_extras::unborrow;
11use futures::future::poll_fn; 11use futures::future::poll_fn;
12 12
@@ -54,12 +54,12 @@ impl<'d, T: Instance> Uarte<'d, T> {
54 /// or [`receive`](Uarte::receive). 54 /// or [`receive`](Uarte::receive).
55 #[allow(unused_unsafe)] 55 #[allow(unused_unsafe)]
56 pub unsafe fn new( 56 pub unsafe fn new(
57 uarte: impl PeripheralBorrow<Target = T> + 'd, 57 uarte: impl Unborrow<Target = T> + 'd,
58 irq: impl PeripheralBorrow<Target = T::Interrupt> + 'd, 58 irq: impl Unborrow<Target = T::Interrupt> + 'd,
59 rxd: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 59 rxd: impl Unborrow<Target = impl GpioPin> + 'd,
60 txd: impl PeripheralBorrow<Target = impl GpioPin> + 'd, 60 txd: impl Unborrow<Target = impl GpioPin> + 'd,
61 cts: impl PeripheralBorrow<Target = impl GpioOptionalPin> + 'd, 61 cts: impl Unborrow<Target = impl GpioOptionalPin> + 'd,
62 rts: impl PeripheralBorrow<Target = impl GpioOptionalPin> + 'd, 62 rts: impl Unborrow<Target = impl GpioOptionalPin> + 'd,
63 config: Config, 63 config: Config,
64 ) -> Self { 64 ) -> Self {
65 unborrow!(uarte, irq, rxd, txd, cts, rts); 65 unborrow!(uarte, irq, rxd, txd, cts, rts);
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 46a7b5a15..ecfad1878 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -5,7 +5,7 @@ use crate::pac::generic::{Reg, RW};
5use crate::pac::SIO; 5use crate::pac::SIO;
6use crate::peripherals; 6use crate::peripherals;
7 7
8use embassy::util::PeripheralBorrow; 8use embassy::util::Unborrow;
9use embassy_extras::{impl_unborrow, unborrow}; 9use embassy_extras::{impl_unborrow, unborrow};
10use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin}; 10use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
11 11
@@ -37,7 +37,7 @@ pub struct Input<'d, T: Pin> {
37} 37}
38 38
39impl<'d, T: Pin> Input<'d, T> { 39impl<'d, T: Pin> Input<'d, T> {
40 pub fn new(pin: impl PeripheralBorrow<Target = T> + 'd, pull: Pull) -> Self { 40 pub fn new(pin: impl Unborrow<Target = T> + 'd, pull: Pull) -> Self {
41 unborrow!(pin); 41 unborrow!(pin);
42 42
43 unsafe { 43 unsafe {
@@ -91,7 +91,7 @@ pub struct Output<'d, T: Pin> {
91 91
92impl<'d, T: Pin> Output<'d, T> { 92impl<'d, T: Pin> Output<'d, T> {
93 // TODO opendrain 93 // TODO opendrain
94 pub fn new(pin: impl PeripheralBorrow<Target = T> + 'd, initial_output: Level) -> Self { 94 pub fn new(pin: impl Unborrow<Target = T> + 'd, initial_output: Level) -> Self {
95 unborrow!(pin); 95 unborrow!(pin);
96 96
97 unsafe { 97 unsafe {
diff --git a/embassy-rp/src/uart.rs b/embassy-rp/src/uart.rs
index 3eb768a7d..2c8986302 100644
--- a/embassy-rp/src/uart.rs
+++ b/embassy-rp/src/uart.rs
@@ -1,6 +1,6 @@
1use core::marker::PhantomData; 1use core::marker::PhantomData;
2 2
3use embassy::util::PeripheralBorrow; 3use embassy::util::Unborrow;
4use embassy_extras::unborrow; 4use embassy_extras::unborrow;
5use gpio::Pin; 5use gpio::Pin;
6 6
@@ -30,11 +30,11 @@ pub struct Uart<'d, T: Instance> {
30 30
31impl<'d, T: Instance> Uart<'d, T> { 31impl<'d, T: Instance> Uart<'d, T> {
32 pub fn new( 32 pub fn new(
33 inner: impl PeripheralBorrow<Target = T>, 33 inner: impl Unborrow<Target = T>,
34 tx: impl PeripheralBorrow<Target = impl TxPin<T>>, 34 tx: impl Unborrow<Target = impl TxPin<T>>,
35 rx: impl PeripheralBorrow<Target = impl RxPin<T>>, 35 rx: impl Unborrow<Target = impl RxPin<T>>,
36 cts: impl PeripheralBorrow<Target = impl CtsPin<T>>, 36 cts: impl Unborrow<Target = impl CtsPin<T>>,
37 rts: impl PeripheralBorrow<Target = impl RtsPin<T>>, 37 rts: impl Unborrow<Target = impl RtsPin<T>>,
38 config: Config, 38 config: Config,
39 ) -> Self { 39 ) -> Self {
40 unborrow!(inner, tx, rx, cts, rts); 40 unborrow!(inner, tx, rx, cts, rts);
diff --git a/embassy/src/util/mod.rs b/embassy/src/util/mod.rs
index 25b570cc6..cace0d190 100644
--- a/embassy/src/util/mod.rs
+++ b/embassy/src/util/mod.rs
@@ -1,15 +1,16 @@
1//! Async utilities 1//! Async utilities
2mod critical_section;
2mod drop_bomb; 3mod drop_bomb;
3mod forever; 4mod forever;
4mod mutex; 5mod mutex;
5mod on_drop; 6mod on_drop;
6mod portal; 7mod portal;
7mod signal; 8mod signal;
8mod critical_section;
9 9
10#[cfg_attr(feature = "executor-agnostic", path = "waker_agnostic.rs")] 10#[cfg_attr(feature = "executor-agnostic", path = "waker_agnostic.rs")]
11mod waker; 11mod waker;
12 12
13pub use critical_section::*;
13pub use drop_bomb::*; 14pub use drop_bomb::*;
14pub use forever::*; 15pub use forever::*;
15pub use mutex::*; 16pub use mutex::*;
@@ -17,9 +18,8 @@ pub use on_drop::*;
17pub use portal::*; 18pub use portal::*;
18pub use signal::*; 19pub use signal::*;
19pub use waker::*; 20pub use waker::*;
20pub use critical_section::*;
21 21
22pub trait PeripheralBorrow { 22pub trait Unborrow {
23 type Target; 23 type Target;
24 unsafe fn unborrow(self) -> Self::Target; 24 unsafe fn unborrow(self) -> Self::Target;
25} 25}