Fix logging matrix firmware build failures
This commit is contained in:
1 parent
6fabd5a155
commit
2cb31ce04f
8 files changed
+48
-23
No files matched your search
@@ -8,15 +8,28 @@ 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);
|
||||
PacketMillis pm = calcMaxPacketMillis(sf, bw, cr, preambleLengthForSF(sf));
|
||||
void powerOff() {
|
||||
_radio->standby();
|
||||
_radio->sleep();
|
||||
}
|
||||
|
||||
protected:
|
||||
bool applyParams(float freq, float bw, uint8_t sf, uint8_t cr) override {
|
||||
if (((CustomLR1121 *)_radio)->setFrequency(freq) != RADIOLIB_ERR_NONE
|
||||
|| ((CustomLR1121 *)_radio)->setSpreadingFactor(sf) != RADIOLIB_ERR_NONE
|
||||
|| ((CustomLR1121 *)_radio)->setBandwidth(bw) != RADIOLIB_ERR_NONE
|
||||
|| ((CustomLR1121 *)_radio)->setCodingRate(cr) != RADIOLIB_ERR_NONE
|
||||
|| !updatePreamble(sf, bw)) return false;
|
||||
PacketMillis pm = calcMaxPacketMillis(sf, bw, cr, preambleLengthForParams(sf, bw));
|
||||
((CustomLR1121 *)_radio)->setPreambleMillis(pm.preambleMillis);
|
||||
((CustomLR1121 *)_radio)->setMaxPayloadMillis(pm.payloadMillis);
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
bool setCodingRate(uint8_t cr) override {
|
||||
if (isCarrierWaveActive()) return false;
|
||||
return ((CustomLR1121 *)_radio)->setCodingRate(cr) == RADIOLIB_ERR_NONE;
|
||||
}
|
||||
|
||||
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz(), getRxBoostedGainMode()); }
|
||||
@@ -31,7 +44,7 @@ public:
|
||||
|
||||
void onSendFinished() override {
|
||||
RadioLibWrapper::onSendFinished();
|
||||
_radio->setPreambleLength(preambleLengthForSF(getSpreadingFactor())); // overcomes weird issues with small and big pkts
|
||||
_radio->setPreambleLength(currentPreambleLength()); // overcomes weird issues with small and big pkts
|
||||
}
|
||||
|
||||
uint32_t getEstAirtimeFor(int len_bytes) override {
|
||||
@@ -39,14 +52,14 @@ public:
|
||||
return airtime < 200 ? 200 : airtime; // at least 200 millis
|
||||
}
|
||||
|
||||
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(); }
|
||||
|
||||
bool setRxBoostedGainMode(bool en) override {
|
||||
protected:
|
||||
bool applyRxBoostedGainMode(bool en) override {
|
||||
return ((CustomLR1121 *)_radio)->setRxBoostedGainMode(en) == RADIOLIB_ERR_NONE;
|
||||
}
|
||||
public:
|
||||
bool supportsRxBoostedGainMode() const override { return true; }
|
||||
bool getRxBoostedGainMode() const override {
|
||||
return ((CustomLR1121 *)_radio)->getRxBoostedGainMode();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user