diff --git a/rust/src/mqtt.rs b/rust/src/mqtt.rs index 2731c93..631827b 100644 --- a/rust/src/mqtt.rs +++ b/rust/src/mqtt.rs @@ -1,3 +1,4 @@ +use crate::bail; use crate::config::NetworkConfig; use crate::fat_error::{ContextExt, FatError, FatResult}; use crate::hal::PlantHal; @@ -135,6 +136,15 @@ 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 + }}; +} + pub async fn mqtt_init( network_config: &'static NetworkConfig, stack: Stack<'static>, @@ -239,15 +249,6 @@ pub async fn mqtt_init( Ok(()) } -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 - }}; -} - #[embassy_executor::task] async fn mqtt_runner( task: McutieTask<'static, String, PublishDisplay<'static, String, &'static str>, 2>,