LR2021: auto-LDRO for side detectors
This commit is contained in:
1 parent
c2b7e56cbc
commit
cb7b158931
6 files changed
+14
-9
No files matched your search
@@ -24,7 +24,7 @@ public:
|
||||
applySideDetectorConfig();
|
||||
}
|
||||
|
||||
bool configSideDetectors(const uint8_t* sideDetSFs, uint8_t num) override {
|
||||
bool configSideDetectors(const uint8_t* sideDetSFs, uint8_t num, float bw) override {
|
||||
LR2021LoRaSideDetector_t tmp[3];
|
||||
uint8_t sf = getSpreadingFactor();
|
||||
|
||||
@@ -35,7 +35,8 @@ public:
|
||||
if (sideDetSFs[i] > sf + 4) { return false; } // span must not be > 4
|
||||
|
||||
tmp[i].sf = sideDetSFs[i];
|
||||
if (sideDetSFs[i] == 10) { // TODO: set ldro=true when tSym >=16
|
||||
float tSym = calcTsym(tmp[i].sf, bw);
|
||||
if (tSym >= 16.0f) {
|
||||
tmp[i].ldro = true;
|
||||
} else {
|
||||
tmp[i].ldro = false;
|
||||
@@ -63,6 +64,11 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
float calcTsym(uint8_t sf, float bw) {
|
||||
float tSym = (float)(uint32_t(1) << sf) / (float)bw;
|
||||
return tSym;
|
||||
}
|
||||
|
||||
bool isReceivingPacket() override {
|
||||
return ((CustomLR2021 *)_radio)->isReceiving();
|
||||
}
|
||||
@@ -98,5 +104,4 @@ public:
|
||||
LR2021LoRaSideDetector_t _sideDet[3];
|
||||
size_t _numSideDet = 0;
|
||||
|
||||
|
||||
};
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
virtual bool setRxBoostedGainMode(bool) { return false; }
|
||||
virtual bool getRxBoostedGainMode() const { return false; }
|
||||
|
||||
virtual bool configSideDetectors(const uint8_t sideDetSFs[], uint8_t num) { return false; }
|
||||
virtual bool configSideDetectors(const uint8_t sideDetSFs[], uint8_t num, float bw) { return false; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user