Skip to content

Commit 102fdf1

Browse files
committed
fixed compilation by just copying over the lr1110 files.
1 parent 287f44d commit 102fdf1

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/helpers/radiolib/CustomLR1121.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ class CustomLR1121 : public LR1121 {
3636
bool detected = ((irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID) || (irq & RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED));
3737
return detected;
3838
}
39+
uint8_t getSpreadingFactor() const { return spreadingFactor; }
40+
3941
};

src/helpers/radiolib/CustomLR1121Wrapper.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
class CustomLR1121Wrapper : public RadioLibWrapper {
88
public:
99
CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
10+
11+
void setParams(float freq, float bw, uint8_t sf, uint8_t cr) override {
12+
((CustomLR1121 *)_radio)->setFrequency(freq);
13+
((CustomLR1121 *)_radio)->setSpreadingFactor(sf);
14+
((CustomLR1121 *)_radio)->setBandwidth(bw);
15+
((CustomLR1121 *)_radio)->setCodingRate(cr);
16+
updatePreamble(sf);
17+
}
18+
1019
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); }
1120
bool isReceivingPacket() override {
1221
return ((CustomLR1121 *)_radio)->isReceiving();
@@ -19,12 +28,14 @@ class CustomLR1121Wrapper : public RadioLibWrapper {
1928

2029
void onSendFinished() override {
2130
RadioLibWrapper::onSendFinished();
22-
_radio->setPreambleLength(16); // overcomes weird issues with small and big pkts
31+
_radio->setPreambleLength(preambleLengthForSF(getSpreadingFactor())); // overcomes weird issues with small and big pkts
2332
}
2433

2534
float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); }
2635
float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); }
2736

37+
uint8_t getSpreadingFactor() const override { return ((CustomLR1121 *)_radio)->getSpreadingFactor(); }
38+
2839
void setRxBoostedGainMode(bool en) override {
2940
((CustomLR1121 *)_radio)->setRxBoostedGainMode(en);
3041
}

0 commit comments

Comments
 (0)