Update preamble dynamically to match runtime SF changes via CLI

This commit is contained in:
overkillfpv
2026-03-05 22:14:22 +11:00
parent 534a0c97a7
commit a61add2e6a
9 changed files with 12 additions and 2 deletions

View File

@@ -19,10 +19,11 @@ public:
void onSendFinished() override {
RadioLibWrapper::onSendFinished();
_radio->setPreambleLength(LORA_SF <= 8 ? 32 : 16); // overcomes weird issues with small and big pkts
_radio->setPreambleLength(getSpreadingFactor() <= 8 ? 32 : 16); // overcomes weird issues with small and big pkts
}
float getLastRSSI() const override { return ((CustomLR1110 *)_radio)->getRSSI(); }
float getLastSNR() const override { return ((CustomLR1110 *)_radio)->getSNR(); }
uint8_t getSpreadingFactor() const override { return ((CustomLR1110 *)_radio)->getSpreadingFactor(); }
int16_t setRxBoostedGainMode(bool en) { return ((CustomLR1110 *)_radio)->setRxBoostedGainMode(en); };
};