mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2024-07-02 14:34:13 +02:00
Fix low data-rate optimisation on SX1262
This commit is contained in:
parent
32424b91a6
commit
184d228991
12
sx126x.cpp
12
sx126x.cpp
@ -755,8 +755,8 @@ void sx126x::setSpreadingFactor(int sf)
|
||||
|
||||
_sf = sf;
|
||||
|
||||
setModulationParams(sf, _bw, _cr, _ldro);
|
||||
handleLowDataRate();
|
||||
setModulationParams(sf, _bw, _cr, _ldro);
|
||||
}
|
||||
|
||||
long sx126x::getSignalBandwidth()
|
||||
@ -778,9 +778,11 @@ long sx126x::getSignalBandwidth()
|
||||
}
|
||||
|
||||
void sx126x::handleLowDataRate(){
|
||||
// TODO: Why was this enabled without any logic to check LDRO conditions?
|
||||
//_ldro = 1;
|
||||
//setModulationParams(_sf, _bw, _cr, _ldro);
|
||||
if ( long( (1<<_sf) / (getSignalBandwidth()/1000)) > 16) {
|
||||
_ldro = 0x01;
|
||||
} else {
|
||||
_ldro = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void sx126x::optimizeModemSensitivity(){
|
||||
@ -811,9 +813,9 @@ void sx126x::setSignalBandwidth(long sbw)
|
||||
_bw = 0x06;
|
||||
}
|
||||
|
||||
handleLowDataRate();
|
||||
setModulationParams(_sf, _bw, _cr, _ldro);
|
||||
|
||||
handleLowDataRate();
|
||||
optimizeModemSensitivity();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user