From 6f8e53c0607dc2aedff5d2a71b8d890f53b07b20 Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:19:07 -0600 Subject: [PATCH] Fix LoRa TX killed by receive() after handle_incoming (untested) --- src/transport/LoRaInterface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/transport/LoRaInterface.cpp b/src/transport/LoRaInterface.cpp index 59e4913..c96b13d 100644 --- a/src/transport/LoRaInterface.cpp +++ b/src/transport/LoRaInterface.cpp @@ -139,8 +139,13 @@ void LoRaInterface::loop() { memcpy(buf.writable(payloadSize), raw + RNODE_HEADER_L, payloadSize); InterfaceImpl::handle_incoming(buf); - // Re-enter RX - _radio->receive(); + // Re-enter RX — but only if handle_incoming didn't trigger a TX. + // handle_incoming() can synchronously call send_outgoing() (for link + // proofs, path responses), which starts an async TX via endPacket(true). + // Calling receive() here would abort that TX (clears IRQ flags + enters RX). + if (!_txPending) { + _radio->receive(); + } } else if (packetSize > 0) { // Packet too small (only header, no payload) — discard Serial.printf("[LORA_IF] RX runt packet (%d bytes), discarding\n", packetSize);