Rename unsafe_impl_unborrow to impl_unborrow

This commit is contained in:
Dario Nieuwenhuis
2022-07-22 22:00:12 +02:00
parent f9f2de3dfb
commit be6408e202
10 changed files with 25 additions and 36 deletions

View File

@ -13,10 +13,10 @@ use core::mem;
use core::pin::Pin;
use core::task::{Context, Poll, Waker};
#[cfg(dmamux)]
pub use dmamux::*;
use embassy_hal_common::unborrow;
use embassy_hal_common::{impl_unborrow, unborrow};
#[cfg(dmamux)]
pub use self::dmamux::*;
use crate::Unborrow;
#[cfg(feature = "unstable-pac")]
@ -294,13 +294,7 @@ pub trait Channel: sealed::Channel + Unborrow<Target = Self> + 'static {}
pub struct NoDma;
unsafe impl Unborrow for NoDma {
type Target = NoDma;
unsafe fn unborrow(self) -> Self::Target {
self
}
}
impl_unborrow!(NoDma);
// safety: must be called only once at startup
pub(crate) unsafe fn init() {

View File

@ -4,7 +4,7 @@ use core::pin::Pin;
use core::task::{Context, Poll};
use embassy::waitqueue::AtomicWaker;
use embassy_hal_common::unsafe_impl_unborrow;
use embassy_hal_common::impl_unborrow;
use crate::gpio::{AnyPin, Input, Pin as GpioPin};
use crate::pac::exti::regs::Lines;
@ -320,7 +320,7 @@ pub trait Channel: sealed::Channel + Sized {
pub struct AnyChannel {
number: u8,
}
unsafe_impl_unborrow!(AnyChannel);
impl_unborrow!(AnyChannel);
impl sealed::Channel for AnyChannel {}
impl Channel for AnyChannel {
fn number(&self) -> usize {

View File

@ -2,7 +2,7 @@
use core::convert::Infallible;
use core::marker::PhantomData;
use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use embassy_hal_common::{impl_unborrow, unborrow};
use crate::pac::gpio::{self, vals};
use crate::{pac, peripherals, Unborrow};
@ -673,7 +673,7 @@ impl AnyPin {
}
}
unsafe_impl_unborrow!(AnyPin);
impl_unborrow!(AnyPin);
impl Pin for AnyPin {
#[cfg(feature = "exti")]
type ExtiChannel = crate::exti::AnyChannel;