[SX127x] Sync with LoRaLib v5.2.2
This commit is contained in:
parent
f4344af3c5
commit
15ee1625c2
4 changed files with 169 additions and 166 deletions
|
@ -69,6 +69,8 @@ int16_t SX1276::setFrequency(float freq) {
|
|||
}
|
||||
}
|
||||
|
||||
// SX1276/77/78 Errata fixes
|
||||
if(getActiveModem() == SX127X_LORA) {
|
||||
// mitigation of receiver spurious response
|
||||
// see SX1276/77/78 Errata, section 2.3 for details
|
||||
if(abs(_bw - 7.8) <= 0.001) {
|
||||
|
@ -116,6 +118,7 @@ int16_t SX1276::setFrequency(float freq) {
|
|||
} else if(abs(_bw - 500.0) <= 0.001) {
|
||||
_mod->SPIsetRegValue(0x31, 0b1000000, 7, 7);
|
||||
}
|
||||
}
|
||||
|
||||
// set frequency
|
||||
return(SX127x::setFrequencyRaw(freq));
|
||||
|
|
|
@ -57,6 +57,8 @@ int16_t SX1277::setFrequency(float freq) {
|
|||
return(ERR_INVALID_FREQUENCY);
|
||||
}
|
||||
|
||||
// SX1276/77/78 Errata fixes
|
||||
if(getActiveModem() == SX127X_LORA) {
|
||||
// sensitivity optimization for 500kHz bandwidth
|
||||
// see SX1276/77/78 Errata, section 2.1 for details
|
||||
if(abs(_bw - 500.0) <= 0.001) {
|
||||
|
@ -116,6 +118,7 @@ int16_t SX1277::setFrequency(float freq) {
|
|||
} else if(abs(_bw - 500.0) <= 0.001) {
|
||||
_mod->SPIsetRegValue(0x31, 0b1000000, 7, 7);
|
||||
}
|
||||
}
|
||||
|
||||
// set frequency and if successful, save the new setting
|
||||
return(SX127x::setFrequencyRaw(freq));
|
||||
|
|
|
@ -84,6 +84,8 @@ int16_t SX1278::setFrequency(float freq) {
|
|||
return(ERR_INVALID_FREQUENCY);
|
||||
}
|
||||
|
||||
// SX1276/77/78 Errata fixes
|
||||
if(getActiveModem() == SX127X_LORA) {
|
||||
// sensitivity optimization for 500kHz bandwidth
|
||||
// see SX1276/77/78 Errata, section 2.1 for details
|
||||
if(abs(_bw - 500.0) <= 0.001) {
|
||||
|
@ -143,6 +145,7 @@ int16_t SX1278::setFrequency(float freq) {
|
|||
} else if(abs(_bw - 500.0) <= 0.001) {
|
||||
_mod->SPIsetRegValue(0x31, 0b1000000, 7, 7);
|
||||
}
|
||||
}
|
||||
|
||||
// set frequency
|
||||
return(SX127x::setFrequencyRaw(freq));
|
||||
|
|
|
@ -1046,12 +1046,6 @@ int16_t SX127x::configFSK() {
|
|||
return(state);
|
||||
}
|
||||
|
||||
// set frequency error to zero
|
||||
// for some reason unbeknownst to man, this write always fails, yet without it, switching modems doesn't work
|
||||
// literally spent 8 hours debugging this ... well played Semtech, well played
|
||||
_mod->SPIsetRegValue(SX127X_REG_FEI_MSB_FSK, 0x00);
|
||||
_mod->SPIsetRegValue(SX127X_REG_FEI_LSB_FSK, 0x00);
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue