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

Esse commit está contido em:
overkillfpv
2026-03-24 15:05:15 +11:00
commit 3843c00f54
+5
Ver Arquivo
@@ -139,6 +139,11 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
} }
uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) { 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; return _radio->getTimeOnAir(len_bytes) / 1000;
} }