Browse Source

added the preamble update into get est airtime as a prevention for false airtime calcs. Left update in the startsendraw as a safety, but should not be used under normal circumstances

pull/1954/head
overkillfpv 2 months ago
parent
commit
3843c00f54
  1. 5
      src/helpers/radiolib/RadioLibWrappers.cpp

5
src/helpers/radiolib/RadioLibWrappers.cpp

@ -139,6 +139,11 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
}
uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {
uint8_t sf = getSpreadingFactor();
if (sf != _preamble_sf) {
_preamble_sf = sf;
_radio->setPreambleLength(preambleLengthForSF(sf)); // sync preamble before airtime estimate
}
return _radio->getTimeOnAir(len_bytes) / 1000;
}

Loading…
Cancel
Save