[SYS] Erase secondary module flash when button is pressed on primary module (#2076)

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-10-01 16:29:03 -05:00
1 parent c234afa9c8
commit e390aca43b
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -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() {
+8
View File
@@ -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