[RF69] OOK functions style cleanup
This commit is contained in:
parent
dec9cb0cfb
commit
31b7bfefe0
2 changed files with 19 additions and 21 deletions
|
@ -370,28 +370,25 @@ int16_t RF69::readData(uint8_t* data, size_t len) {
|
|||
}
|
||||
|
||||
int16_t RF69::setOOK(bool enableOOK) {
|
||||
// set OOK and if successful, save the new setting
|
||||
int16_t state = ERR_NONE;
|
||||
if(enableOOK) {
|
||||
state = _mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_OOK, 4, 3, 5);
|
||||
} else {
|
||||
state = _mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_FSK, 4, 3, 5);
|
||||
}
|
||||
if(state == ERR_NONE) {
|
||||
_ook = enableOOK;
|
||||
}
|
||||
// set OOK and if successful, save the new setting
|
||||
int16_t state = ERR_NONE;
|
||||
if(enableOOK) {
|
||||
state = _mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_OOK, 4, 3, 5);
|
||||
} else {
|
||||
state = _mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_FSK, 4, 3, 5);
|
||||
}
|
||||
if(state == ERR_NONE) {
|
||||
_ook = enableOOK;
|
||||
}
|
||||
|
||||
return(state);
|
||||
return(state);
|
||||
}
|
||||
|
||||
int16_t RF69::setOokThresholdType(uint8_t type) {
|
||||
if(type != RF69_OOK_THRESH_FIXED && type != RF69_OOK_THRESH_PEAK && type != RF69_OOK_THRESH_AVERAGE)
|
||||
return ERR_INVALID_OOK_RSSI_PEAK_TYPE;
|
||||
|
||||
int16_t state = ERR_NONE;
|
||||
state = _mod->SPIsetRegValue(RF69_REG_OOK_PEAK, type, 7, 3, 5);
|
||||
|
||||
return(state);
|
||||
if((type != RF69_OOK_THRESH_FIXED) && (type != RF69_OOK_THRESH_PEAK) && (type != RF69_OOK_THRESH_AVERAGE)) {
|
||||
return(ERR_INVALID_OOK_RSSI_PEAK_TYPE);
|
||||
}
|
||||
return(_mod->SPIsetRegValue(RF69_REG_OOK_PEAK, type, 7, 3, 5));
|
||||
}
|
||||
|
||||
int16_t RF69::setFrequency(float freq) {
|
||||
|
|
|
@ -751,7 +751,8 @@ class RF69: public PhysicalLayer {
|
|||
/*!
|
||||
\brief Selects the type of threshold in the OOK data slicer
|
||||
|
||||
\param type RF69_OOK_THRESH_FIXED RF69_OOK_THRESH_PEAK(default) RF69_OOK_THRESH_AVERAGE
|
||||
\param type Threshold type: RF69_OOK_THRESH_PEAK(default), RF69_OOK_THRESH_FIXED or RF69_OOK_THRESH_AVERAGE
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setOokThresholdType(uint8_t type);
|
||||
|
@ -829,9 +830,9 @@ class RF69: public PhysicalLayer {
|
|||
int16_t setEncoding(uint8_t encoding) override;
|
||||
|
||||
/*!
|
||||
\brief enable/disable LNA Boost mode (disabled by default
|
||||
\brief Enable/disable LNA Boost mode (disabled by default).
|
||||
|
||||
\param value true to enable, false to disable
|
||||
\param value True to enable, false to disable.
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue