Browse Source

Prevent packet errors from growing

pull/1727/head
Wessel Nieboer 3 months ago
committed by Wessel Nieboer
parent
commit
099ef67348
No known key found for this signature in database GPG Key ID: 929C8E45E33B5FD2
  1. 5
      src/helpers/radiolib/RadioLibWrappers.cpp

5
src/helpers/radiolib/RadioLibWrappers.cpp

@ -186,7 +186,10 @@ bool RadioLibWrapper::isChannelActive() {
if (_threshold == 0) return false; // interference check is disabled if (_threshold == 0) return false; // interference check is disabled
int16_t result = performChannelScan(); int16_t result = performChannelScan();
// scanChannel() leaves radio in standby — restart RX regardless of result // scanChannel() triggers DIO interrupt (CAD done) which sets STATE_INT_READY
// via setFlag() ISR. Clear it before restarting RX so recvRaw() doesn't
// try to read a non-existent packet and count a spurious recv error.
state = STATE_IDLE;
startRecv(); startRecv();
return result != RADIOLIB_CHANNEL_FREE; return result != RADIOLIB_CHANNEL_FREE;
} }

Loading…
Cancel
Save