fixes critical error 8 does not reboot on nrf52

This commit is contained in:
Thomas Göttgens 2022-12-09 11:15:49 +01:00
parent e3d8c5c7a6
commit edb674759f

View File

@ -3,6 +3,7 @@
#include "NodeDB.h" #include "NodeDB.h"
#include "SPILock.h" #include "SPILock.h"
#include "configuration.h" #include "configuration.h"
#include "main.h"
#include "error.h" #include "error.h"
#include "mesh-pb-constants.h" #include "mesh-pb-constants.h"
#include <pb_decode.h> #include <pb_decode.h>
@ -87,10 +88,8 @@ bool RadioLibInterface::canSendImmediately()
if (busyTx && (millis() - lastTxStart > 60000)) { if (busyTx && (millis() - lastTxStart > 60000)) {
DEBUG_MSG("Hardware Failure! busyTx for more than 60s\n"); DEBUG_MSG("Hardware Failure! busyTx for more than 60s\n");
RECORD_CRITICALERROR(CriticalErrorCode_TRANSMIT_FAILED); RECORD_CRITICALERROR(CriticalErrorCode_TRANSMIT_FAILED);
#ifdef ARCH_ESP32 // reboot in 5 seconds when this condition occurs.
if (busyTx && (millis() - lastTxStart > 65000)) // After 5s more, reboot rebootAtMsec = lastTxStart + 65000;
ESP.restart();
#endif
} }
if (busyRx) if (busyRx)
DEBUG_MSG("Can not send yet, busyRx\n"); DEBUG_MSG("Can not send yet, busyRx\n");