[nRF24] Fixed variable shadowing
This commit is contained in:
parent
674c37d00b
commit
c5a3c4d361
2 changed files with 5 additions and 6 deletions
|
@ -304,14 +304,14 @@ int16_t nRF24::setBitRate(float br) {
|
|||
return(state);
|
||||
}
|
||||
|
||||
int16_t nRF24::setOutputPower(int8_t power) {
|
||||
int16_t nRF24::setOutputPower(int8_t pwr) {
|
||||
// set mode to standby
|
||||
int16_t state = standby();
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// check allowed values
|
||||
uint8_t powerRaw = 0;
|
||||
switch(power) {
|
||||
switch(pwr) {
|
||||
case -18:
|
||||
powerRaw = RADIOLIB_NRF24_RF_PWR_18_DBM;
|
||||
break;
|
||||
|
@ -332,10 +332,9 @@ int16_t nRF24::setOutputPower(int8_t power) {
|
|||
state = this->mod->SPIsetRegValue(RADIOLIB_NRF24_REG_RF_SETUP, powerRaw, 2, 1);
|
||||
|
||||
if(state == RADIOLIB_ERR_NONE) {
|
||||
this->power = power;
|
||||
this->power = pwr;
|
||||
}
|
||||
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
|
|
|
@ -330,10 +330,10 @@ class nRF24: public PhysicalLayer {
|
|||
|
||||
/*!
|
||||
\brief Sets output power. Allowed values are -18, -12, -6 or 0 dBm.
|
||||
\param power Output power to be set in dBm.
|
||||
\param pwr Output power to be set in dBm.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setOutputPower(int8_t power);
|
||||
int16_t setOutputPower(int8_t pwr);
|
||||
|
||||
/*!
|
||||
\brief Sets address width of transmit and receive pipes in bytes. Allowed values are 3, 4 or 5 bytes.
|
||||
|
|
Loading…
Add table
Reference in a new issue