mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-04-26 10:57:20 +00:00
Fix LoRa TX killed by receive() after handle_incoming (untested)
Some checks failed
PlatformIO Build / build (push) Failing after 13m14s
PlatformIO Build / release (push) Has been skipped
Some checks failed
PlatformIO Build / build (push) Failing after 13m14s
PlatformIO Build / release (push) Has been skipped
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user