refactor: create util module with shared mk_static

- use crate::util::mk_static in network module
- use crate::util::mk_static in mqtt module
- use crate::util::mk_static in hal module
- remove dead mk_static macro from esp module
This commit is contained in:
2026-05-10 14:01:56 +02:00
parent d3d8d829be
commit 7497a8c05d
6 changed files with 14 additions and 34 deletions

View File

@@ -110,14 +110,7 @@ async fn publish_inner(subtopic: &str, message: &str) -> FatResult<()> {
}
}
macro_rules! 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
}};
}
use crate::util::mk_static;
pub async fn mqtt_init(
network_config: &'static NetworkConfig,