refactor: use crate::util::mk_static in hal module

This commit is contained in:
2026-05-10 13:54:07 +02:00
parent 13d6b44f2c
commit 72ee12ec7a

View File

@@ -282,14 +282,7 @@ pub struct FreePeripherals<'a> {
pub adc1: ADC1<'a>, pub adc1: ADC1<'a>,
} }
macro_rules! mk_static { use crate::util::mk_static;
($t:ty,$val:expr) => {{
static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new();
#[deny(unused_attributes)]
let x = STATIC_CELL.uninit().write(($val));
x
}};
}
impl PlantHal { impl PlantHal {
pub async fn create() -> Result<Mutex<CriticalSectionRawMutex, HAL<'static>>, FatError> { pub async fn create() -> Result<Mutex<CriticalSectionRawMutex, HAL<'static>>, FatError> {