General clean-up and removal of dead code.
This commit is contained in:
parent
d75bf143eb
commit
240616aa72
@ -212,31 +212,6 @@ impl_exti!(EXTI13, 13);
|
|||||||
impl_exti!(EXTI14, 14);
|
impl_exti!(EXTI14, 14);
|
||||||
impl_exti!(EXTI15, 15);
|
impl_exti!(EXTI15, 15);
|
||||||
|
|
||||||
pub(crate) unsafe fn init() {}
|
|
||||||
|
|
||||||
/*
|
|
||||||
macro_rules! impl_exti_irq {
|
|
||||||
($($e:ident),+) => {
|
|
||||||
/// safety: must be called only once
|
|
||||||
pub(crate) unsafe fn init_exti() {
|
|
||||||
use embassy::interrupt::Interrupt;
|
|
||||||
use embassy::interrupt::InterruptExt;
|
|
||||||
|
|
||||||
$(
|
|
||||||
crate::interrupt::$e::steal().enable();
|
|
||||||
)+
|
|
||||||
}
|
|
||||||
|
|
||||||
$(
|
|
||||||
#[crate::interrupt]
|
|
||||||
unsafe fn $e() {
|
|
||||||
crate::exti::on_irq()
|
|
||||||
}
|
|
||||||
)+
|
|
||||||
};
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
macro_rules! foreach_exti_irq {
|
macro_rules! foreach_exti_irq {
|
||||||
($action:ident) => {
|
($action:ident) => {
|
||||||
crate::pac::interrupts!(
|
crate::pac::interrupts!(
|
||||||
@ -278,7 +253,7 @@ macro_rules! enable_irq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// safety: must be called only once
|
/// safety: must be called only once
|
||||||
pub(crate) unsafe fn init_exti() {
|
pub(crate) unsafe fn init() {
|
||||||
use embassy::interrupt::Interrupt;
|
use embassy::interrupt::Interrupt;
|
||||||
use embassy::interrupt::InterruptExt;
|
use embassy::interrupt::InterruptExt;
|
||||||
|
|
||||||
|
@ -40,13 +40,13 @@ pub trait SdaPin<T: Instance>: sealed::SdaPin<T> + 'static {}
|
|||||||
|
|
||||||
crate::pac::peripherals!(
|
crate::pac::peripherals!(
|
||||||
(i2c, $inst:ident) => {
|
(i2c, $inst:ident) => {
|
||||||
impl crate::i2c::sealed::Instance for peripherals::$inst {
|
impl sealed::Instance for peripherals::$inst {
|
||||||
fn regs() -> &'static crate::pac::i2c::I2c {
|
fn regs() -> &'static crate::pac::i2c::I2c {
|
||||||
&crate::pac::$inst
|
&crate::pac::$inst
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl crate::i2c::Instance for peripherals::$inst {}
|
impl Instance for peripherals::$inst {}
|
||||||
|
|
||||||
};
|
};
|
||||||
);
|
);
|
||||||
|
@ -83,7 +83,7 @@ pub fn init(config: Config) -> Peripherals {
|
|||||||
|
|
||||||
#[cfg(dma)]
|
#[cfg(dma)]
|
||||||
dma::init();
|
dma::init();
|
||||||
exti::init_exti();
|
exti::init();
|
||||||
rcc::init(config.rcc);
|
rcc::init(config.rcc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,31 +185,3 @@ crate::pac::interrupts!(
|
|||||||
irq!(HASH_RNG);
|
irq!(HASH_RNG);
|
||||||
};
|
};
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
macro_rules! impl_rng {
|
|
||||||
($inst:ident, $irq:ident) => {
|
|
||||||
impl crate::rng::sealed::Instance for peripherals::RNG {
|
|
||||||
fn regs() -> crate::pac::rng::Rng {
|
|
||||||
crate::pac::RNG
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl crate::rng::Instance for peripherals::RNG {}
|
|
||||||
|
|
||||||
mod rng_irq {
|
|
||||||
use crate::interrupt;
|
|
||||||
|
|
||||||
#[interrupt]
|
|
||||||
unsafe fn $irq() {
|
|
||||||
let bits = $crate::pac::RNG.sr().read();
|
|
||||||
if bits.drdy() || bits.seis() || bits.ceis() {
|
|
||||||
$crate::pac::RNG.cr().write(|reg| reg.set_ie(false));
|
|
||||||
$crate::rng::RNG_WAKER.wake();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
@ -1476,7 +1476,7 @@ crate::pac::peripherals!(
|
|||||||
type Interrupt = crate::interrupt::$inst;
|
type Interrupt = crate::interrupt::$inst;
|
||||||
|
|
||||||
fn inner() -> SdmmcInner {
|
fn inner() -> SdmmcInner {
|
||||||
const INNER: crate::sdmmc::SdmmcInner = crate::sdmmc::SdmmcInner(crate::pac::$inst);
|
const INNER: SdmmcInner = SdmmcInner(crate::pac::$inst);
|
||||||
INNER
|
INNER
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1492,11 +1492,11 @@ crate::pac::peripherals!(
|
|||||||
|
|
||||||
macro_rules! impl_pin {
|
macro_rules! impl_pin {
|
||||||
($inst:ident, $pin:ident, $signal:ident, $af:expr) => {
|
($inst:ident, $pin:ident, $signal:ident, $af:expr) => {
|
||||||
impl crate::sdmmc::sealed::$signal<peripherals::$inst> for peripherals::$pin {
|
impl sealed::$signal<peripherals::$inst> for peripherals::$pin {
|
||||||
const AF_NUM: u8 = $af;
|
const AF_NUM: u8 = $af;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl crate::sdmmc::$signal<peripherals::$inst> for peripherals::$pin {}
|
impl $signal<peripherals::$inst> for peripherals::$pin {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user