From 102fdf112dd76d3b2c4e5e75f45dbae8d56fca1c Mon Sep 17 00:00:00 2001 From: Ev Lbibass Date: Mon, 18 May 2026 18:53:34 -0400 Subject: [PATCH] fixed compilation by just copying over the lr1110 files. --- src/helpers/radiolib/CustomLR1121.h | 2 ++ src/helpers/radiolib/CustomLR1121Wrapper.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/helpers/radiolib/CustomLR1121.h b/src/helpers/radiolib/CustomLR1121.h index e549d6e77..873bfabc4 100644 --- a/src/helpers/radiolib/CustomLR1121.h +++ b/src/helpers/radiolib/CustomLR1121.h @@ -36,4 +36,6 @@ class CustomLR1121 : public LR1121 { bool detected = ((irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID) || (irq & RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED)); return detected; } + uint8_t getSpreadingFactor() const { return spreadingFactor; } + }; \ No newline at end of file diff --git a/src/helpers/radiolib/CustomLR1121Wrapper.h b/src/helpers/radiolib/CustomLR1121Wrapper.h index 6017c1c1d..941e2ff1e 100644 --- a/src/helpers/radiolib/CustomLR1121Wrapper.h +++ b/src/helpers/radiolib/CustomLR1121Wrapper.h @@ -7,6 +7,15 @@ class CustomLR1121Wrapper : public RadioLibWrapper { public: CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { } + + void setParams(float freq, float bw, uint8_t sf, uint8_t cr) override { + ((CustomLR1121 *)_radio)->setFrequency(freq); + ((CustomLR1121 *)_radio)->setSpreadingFactor(sf); + ((CustomLR1121 *)_radio)->setBandwidth(bw); + ((CustomLR1121 *)_radio)->setCodingRate(cr); + updatePreamble(sf); + } + void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); } bool isReceivingPacket() override { return ((CustomLR1121 *)_radio)->isReceiving(); @@ -19,12 +28,14 @@ public: void onSendFinished() override { RadioLibWrapper::onSendFinished(); - _radio->setPreambleLength(16); // overcomes weird issues with small and big pkts + _radio->setPreambleLength(preambleLengthForSF(getSpreadingFactor())); // overcomes weird issues with small and big pkts } float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); } float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); } + uint8_t getSpreadingFactor() const override { return ((CustomLR1121 *)_radio)->getSpreadingFactor(); } + void setRxBoostedGainMode(bool en) override { ((CustomLR1121 *)_radio)->setRxBoostedGainMode(en); }