From 0f0dbc327444afa11de6b4d9d5488123abfa6c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 9 Dec 2022 11:18:43 +0100 Subject: [PATCH] reboot nrf52 on critical error 8 --- src/mesh/RadioLibInterface.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 022576659..18f2ef2f1 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -3,6 +3,7 @@ #include "NodeDB.h" #include "SPILock.h" #include "configuration.h" +#include "main.h" #include "error.h" #include "mesh-pb-constants.h" #include @@ -87,10 +88,8 @@ bool RadioLibInterface::canSendImmediately() if (busyTx && (millis() - lastTxStart > 60000)) { DEBUG_MSG("Hardware Failure! busyTx for more than 60s\n"); RECORD_CRITICALERROR(CriticalErrorCode_TRANSMIT_FAILED); -#ifdef ARCH_ESP32 - if (busyTx && (millis() - lastTxStart > 65000)) // After 5s more, reboot - ESP.restart(); -#endif + // reboot in 5 seconds when this condition occurs. + rebootAtMsec = lastTxStart + 65000; } if (busyRx) DEBUG_MSG("Can not send yet, busyRx\n");