[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:
1 parent
c234afa9c8
commit
e390aca43b
2 files changed
+9
-1
No files matched your search
@@ -149,7 +149,7 @@ void sendHeartbeatAck() {
|
|||||||
SERIALStream->print("{\"type\":\"heartbeat_ack\"}");
|
SERIALStream->print("{\"type\":\"heartbeat_ack\"}");
|
||||||
SERIALStream->print(SERIALPost);
|
SERIALStream->print(SERIALPost);
|
||||||
SERIALStream->flush();
|
SERIALStream->flush();
|
||||||
Log.notice(F("Sent heartbeat ack" CR));
|
Log.trace(F("Sent heartbeat ack" CR));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SERIALtoX() {
|
void SERIALtoX() {
|
||||||
|
|||||||
@@ -1871,6 +1871,14 @@ void blockingWaitForReset() {
|
|||||||
if (level == ACTUATOR_ON) {
|
if (level == ACTUATOR_ON) {
|
||||||
ActuatorTrigger();
|
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
|
# endif
|
||||||
// Checking if the flash has already been erased to identify if we erase it or go into failsafe mode
|
// 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
|
// going to failsafe mode is done by doing a long button press from a state where the flash has already been erased
|
||||||
|
|||||||
Reference in new issue
Block a user