Remove usage of old PAC

Formatting
This commit is contained in:
Corey Schuhen 2024-03-07 08:11:10 +10:00
parent 65b38cf755
commit 9ba379fb9e
2 changed files with 2 additions and 14 deletions

View file

@ -29,8 +29,6 @@ mod frame;
mod id;
#[allow(clippy::all)] // generated code
mod pac;
use core::cmp::{Ord, Ordering};
use core::convert::{Infallible, TryInto};
use core::marker::PhantomData;
@ -38,10 +36,8 @@ use core::mem;
pub use id::{ExtendedId, Id, StandardId};
use self::pac::generic::*;
use crate::can::bx::filter::MasterFilters;
pub use crate::can::bx::frame::{Data, Frame, FramePriority};
pub use crate::can::bx::pac::can::RegisterBlock; // To make the PAC extraction build
/// A bxCAN peripheral instance.
///
@ -56,10 +52,7 @@ pub use crate::can::bx::pac::can::RegisterBlock; // To make the PAC extraction b
/// register block.
/// * `REGISTERS` is a pointer to that peripheral's register block and can be safely accessed for as
/// long as ownership or a borrow of the implementing type is present.
pub unsafe trait Instance {
/// Pointer to the instance's register block.
const REGISTERS: *mut RegisterBlock;
}
pub unsafe trait Instance {}
/// A bxCAN instance that owns filter banks.
///

View file

@ -509,8 +509,6 @@ pub(crate) mod sealed {
}
pub trait Instance {
const REGISTERS: *mut crate::can::bx::RegisterBlock;
fn regs() -> crate::pac::can::Can;
fn state() -> &'static State;
}
@ -531,14 +529,11 @@ pub trait Instance: sealed::Instance + RccPeripheral + 'static {
/// BXCAN instance newtype.
pub struct BxcanInstance<'a, T>(PeripheralRef<'a, T>);
unsafe impl<'d, T: Instance> crate::can::bx::Instance for BxcanInstance<'d, T> {
const REGISTERS: *mut crate::can::bx::RegisterBlock = T::REGISTERS;
}
unsafe impl<'d, T: Instance> crate::can::bx::Instance for BxcanInstance<'d, T> {}
foreach_peripheral!(
(can, $inst:ident) => {
impl sealed::Instance for peripherals::$inst {
const REGISTERS: *mut crate::can::bx::RegisterBlock = crate::pac::$inst.as_ptr() as *mut _;
fn regs() -> crate::pac::can::Can {
crate::pac::$inst