From 6934e0bce7a18fb087e54c8f443ef14f04c5d300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 6 Nov 2022 18:36:17 +0100 Subject: [PATCH] Fix assert --- src/mesh/RadioLibInterface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 262a10c18..c08220555 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -317,7 +317,13 @@ ErrorCode RadioLibInterface::send(MeshPacket *p) void RadioLibInterface::handleReceiveInterrupt() { uint32_t xmitMsec; - assert(isReceiving); + + // when this is called, we should be in receive mode - if we are not, just jump out instead of bombing. Possible Race Condition? + if (!isReceiving) { + DEBUG_MSG("*** WAS_ASSERT *** handleReceiveInterrupt called when not in receive mode\n"); + return; + } + isReceiving = false; // read the number of actually received bytes