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

此提交包含在:
overkillfpv
2026-03-24 15:05:15 +11:00
父節點 a434f9eff5
當前提交 3843c00f54
+5
查看文件
@@ -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;
} }