[SX127x] Fixed FSK preamble unit
This commit is contained in:
parent
bc613daf23
commit
f1d51fd1b9
2 changed files with 6 additions and 5 deletions
|
@ -599,9 +599,10 @@ int16_t SX127x::setPreambleLength(uint16_t preambleLength) {
|
||||||
return(state);
|
return(state);
|
||||||
|
|
||||||
} else if(modem == SX127X_FSK_OOK) {
|
} else if(modem == SX127X_FSK_OOK) {
|
||||||
// set preamble length
|
// set preamble length (in bytes)
|
||||||
state = _mod->SPIsetRegValue(SX127X_REG_PREAMBLE_MSB_FSK, (uint8_t)((preambleLength >> 8) & 0xFF));
|
uint16_t numBytes = preambleLength / 8;
|
||||||
state |= _mod->SPIsetRegValue(SX127X_REG_PREAMBLE_LSB_FSK, (uint8_t)(preambleLength & 0xFF));
|
state = _mod->SPIsetRegValue(SX127X_REG_PREAMBLE_MSB_FSK, (uint8_t)((numBytes >> 8) & 0xFF));
|
||||||
|
state |= _mod->SPIsetRegValue(SX127X_REG_PREAMBLE_LSB_FSK, (uint8_t)(numBytes & 0xFF));
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -745,9 +745,9 @@ class SX127x: public PhysicalLayer {
|
||||||
int16_t setCurrentLimit(uint8_t currentLimit);
|
int16_t setCurrentLimit(uint8_t currentLimit);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets %LoRa preamble length. Allowed values range from 6 to 65535. Only available in %LoRa mode.
|
\brief Sets %LoRa or FSK preamble length. Allowed values range from 6 to 65535 in %LoRa mode or 0 to 65535 in FSK mode.
|
||||||
|
|
||||||
\param preambleLength Preamble length to be set (in symbols).
|
\param preambleLength Preamble length to be set (in symbols when in LoRa mode or bits in FSK mode).
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue