Browse Source

fixed compilation by just copying over the lr1110 files.

pull/2054/head
Ev Lbibass 2 months ago
parent
commit
102fdf112d
  1. 2
      src/helpers/radiolib/CustomLR1121.h
  2. 13
      src/helpers/radiolib/CustomLR1121Wrapper.h

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

13
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);
}

Loading…
Cancel
Save