Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral

This commit is contained in:
Dario Nieuwenhuis
2022-07-23 14:00:19 +02:00
parent 8a9d2f59af
commit 4901c34d9c
62 changed files with 970 additions and 918 deletions

View File

@ -21,7 +21,7 @@ macro_rules! peripherals {
}
$(#[$cfg])?
$crate::impl_unborrow!($name);
$crate::impl_peripheral!($name);
)*
}
@ -71,22 +71,22 @@ macro_rules! peripherals {
}
#[macro_export]
macro_rules! unborrow {
macro_rules! into_ref {
($($name:ident),*) => {
$(
let mut $name = $name.unborrow();
let mut $name = $name.into_ref();
)*
}
}
#[macro_export]
macro_rules! impl_unborrow {
macro_rules! impl_peripheral {
($type:ident) => {
impl $crate::Unborrow for $type {
type Target = $type;
impl $crate::Peripheral for $type {
type P = $type;
#[inline]
unsafe fn unborrow_unchecked(&mut self) -> Self::Target {
unsafe fn clone_unchecked(&mut self) -> Self::P {
$type { ..*self }
}
}