From 599e3a187cac5b4ea7060abef6b4260215943f62 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 20 Jul 2025 23:27:54 +1200 Subject: [PATCH] start rx again immediately after receive --- src/helpers/radiolib/RadioLibWrappers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/radiolib/RadioLibWrappers.cpp b/src/helpers/radiolib/RadioLibWrappers.cpp index 96fb7aab..9014743a 100644 --- a/src/helpers/radiolib/RadioLibWrappers.cpp +++ b/src/helpers/radiolib/RadioLibWrappers.cpp @@ -96,8 +96,9 @@ bool RadioLibWrapper::isInRecvMode() const { } int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) { + int len = 0; if (state & STATE_INT_READY) { - int len = _radio->getPacketLength(); + len = _radio->getPacketLength(); if (len > 0) { if (len > sz) { len = sz; } int err = _radio->readData(bytes, len); @@ -110,7 +111,6 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) { } } state = STATE_IDLE; // need another startReceive() - return len; } if (state != STATE_RX) { @@ -121,7 +121,7 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) { MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startReceive(%d)", err); } } - return 0; + return len; } uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {