Call setRxBandwidth again if setOOK is called
This commit is contained in:
parent
77fa0e83c0
commit
63ba279fd2
2 changed files with 7 additions and 6 deletions
|
@ -9,7 +9,7 @@ Module* RF69::getMod() {
|
|||
return(_mod);
|
||||
}
|
||||
|
||||
int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen, bool enableOOK) {
|
||||
int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen) {
|
||||
// set module properties
|
||||
_mod->init();
|
||||
_mod->pinMode(_mod->getIrq(), INPUT);
|
||||
|
@ -54,10 +54,6 @@ int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t powe
|
|||
int16_t state = config();
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// enable/disable OOK
|
||||
state = setOOK(enableOOK);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// configure publicly accessible settings
|
||||
state = setFrequency(freq);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
@ -394,10 +390,14 @@ int16_t RF69::setOOK(bool enableOOK) {
|
|||
} else {
|
||||
state = _mod->SPIsetRegValue(RADIOLIB_RF69_REG_DATA_MODUL, RADIOLIB_RF69_FSK, 4, 3, 5);
|
||||
}
|
||||
|
||||
if(state == RADIOLIB_ERR_NONE) {
|
||||
_ook = enableOOK;
|
||||
}
|
||||
|
||||
// call setRxBandwidth again, since register values differ based on OOK mode being enabled
|
||||
state |= setRxBandwidth(_rxBw);
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
|
|
|
@ -473,7 +473,7 @@ class RF69: public PhysicalLayer {
|
|||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 125.0, int8_t power = 10, uint8_t preambleLen = 16, bool enableOOK = false);
|
||||
int16_t begin(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 125.0, int8_t power = 10, uint8_t preambleLen = 16);
|
||||
|
||||
/*!
|
||||
\brief Reset method. Will reset the chip to the default state using RST pin.
|
||||
|
@ -744,6 +744,7 @@ class RF69: public PhysicalLayer {
|
|||
|
||||
/*!
|
||||
\brief Enables/disables OOK modulation instead of FSK.
|
||||
Note: This function calls setRxBandwidth again, since register values differ based on OOK mode being enabled/disabled
|
||||
|
||||
\param enableOOK Enable (true) or disable (false) OOK.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue