mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2024-10-01 03:15:39 -04: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;
|
_sf = sf;
|
||||||
|
|
||||||
setModulationParams(sf, _bw, _cr, _ldro);
|
|
||||||
handleLowDataRate();
|
handleLowDataRate();
|
||||||
|
setModulationParams(sf, _bw, _cr, _ldro);
|
||||||
}
|
}
|
||||||
|
|
||||||
long sx126x::getSignalBandwidth()
|
long sx126x::getSignalBandwidth()
|
||||||
@ -778,9 +778,11 @@ long sx126x::getSignalBandwidth()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sx126x::handleLowDataRate(){
|
void sx126x::handleLowDataRate(){
|
||||||
// TODO: Why was this enabled without any logic to check LDRO conditions?
|
if ( long( (1<<_sf) / (getSignalBandwidth()/1000)) > 16) {
|
||||||
//_ldro = 1;
|
_ldro = 0x01;
|
||||||
//setModulationParams(_sf, _bw, _cr, _ldro);
|
} else {
|
||||||
|
_ldro = 0x00;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sx126x::optimizeModemSensitivity(){
|
void sx126x::optimizeModemSensitivity(){
|
||||||
@ -811,9 +813,9 @@ void sx126x::setSignalBandwidth(long sbw)
|
|||||||
_bw = 0x06;
|
_bw = 0x06;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleLowDataRate();
|
||||||
setModulationParams(_sf, _bw, _cr, _ldro);
|
setModulationParams(_sf, _bw, _cr, _ldro);
|
||||||
|
|
||||||
handleLowDataRate();
|
|
||||||
optimizeModemSensitivity();
|
optimizeModemSensitivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user