mysensors / MySensors

MySensors library and examples

Home Page:https://www.mysensors.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RF24 reports that 50% TX Powerlevel is used with RF24_PA_MAX

joro75 opened this issue · comments

When MY_SIGNAL_REPORT_ENABLED is defined, the Transmit power percentage (SR_TX_POWER_PERCENT) can be requested.
When the powerlevel of the RF24 is set to RF24_PA_MAX (which is the maximum), 50% is returned.
This is not correct, and also doesn't match with the Power level that can be requested (SR_TX_POWER_LEVEL), which is correctly reported as 0 dBm (which is the maximum).

This is caused by a wrong shift of the RF_SETUP register on line 412 of RF24.cpp (

const uint8_t result = 25 + (((RF24_readByteRegister(RF24_REG_RF_SETUP) >> 2) & 3) * 25);
)
The right shift shouldn't be 2 but it should be a right shift of 1, as it is used on line 406.

@joro75 Good catch! Thanks for reporting

@tekka007 Not a problem. Thanks for fixing!