diff --git a/rust/src/main.rs b/rust/src/main.rs index e20927e..0bf662e 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -18,7 +18,7 @@ use hal::PROGRESS_ACTIVE; use crate::config::{NetworkConfig, PlantConfig}; use crate::fat_error::FatResult; -use crate::hal::esp::MQTT_STAY_ALIVE; + use crate::log::log; use crate::tank::{determine_tank_state, TankError, TankState, WATER_FROZEN_THRESH}; use crate::webserver::http_server; @@ -519,7 +519,7 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> { //TODO //mark_app_valid(); - let stay_alive = MQTT_STAY_ALIVE.load(Ordering::Relaxed); + let stay_alive = mqtt::is_stay_alive(); info!("Check stay alive, current state is {}", stay_alive); if stay_alive { @@ -1003,7 +1003,7 @@ async fn wait_infinity( hal::PlantHal::feed_watchdog(); - if wait_type == WaitType::MqttConfig && !MQTT_STAY_ALIVE.load(Ordering::Relaxed) { + if wait_type == WaitType::MqttConfig && !mqtt::is_stay_alive() { reboot_now.store(true, Ordering::Relaxed); } if reboot_now.load(Ordering::Relaxed) {