From e390aca43b72d0679209b1c85da950714448f621 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 1 Oct 2024 16:29:03 -0500 Subject: [PATCH] [SYS] Erase secondary module flash when button is pressed on primary module (#2076) Co-authored-by: Florian <1technophile@users.noreply.github.com> --- main/ZgatewaySERIAL.ino | 2 +- main/main.ino | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main/ZgatewaySERIAL.ino b/main/ZgatewaySERIAL.ino index 9e31991..0fb7ee5 100644 --- a/main/ZgatewaySERIAL.ino +++ b/main/ZgatewaySERIAL.ino @@ -149,7 +149,7 @@ void sendHeartbeatAck() { SERIALStream->print("{\"type\":\"heartbeat_ack\"}"); SERIALStream->print(SERIALPost); SERIALStream->flush(); - Log.notice(F("Sent heartbeat ack" CR)); + Log.trace(F("Sent heartbeat ack" CR)); } void SERIALtoX() { diff --git a/main/main.ino b/main/main.ino index a06e8a6..635f40b 100644 --- a/main/main.ino +++ b/main/main.ino @@ -1871,6 +1871,14 @@ void blockingWaitForReset() { if (level == ACTUATOR_ON) { ActuatorTrigger(); } +# endif + ledManager.setMode(-1, -1, LEDManager::STATIC, LED_WAITING_ONBOARD_COLOR, -1); +# ifdef SecondaryModule + // Erase the secondary module config + String eraseCmdStr = "{\"cmd\":\"" + String(eraseCmd) + "\"}"; + Log.notice(F("Erasing secondary module config: %s" CR), eraseCmdStr.c_str()); + receivingDATA(subjectMQTTtoSYSsetSecondaryModule, eraseCmdStr.c_str()); + delay(5000); # endif // Checking if the flash has already been erased to identify if we erase it or go into failsafe mode // going to failsafe mode is done by doing a long button press from a state where the flash has already been erased