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

This commit is contained in:
overkillfpv
2026-03-24 15:05:15 +11:00
parent a434f9eff5
commit 3843c00f54

View File

@@ -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;
}