drivers: lora: sx1276: stop reading PA_CONFIG
All fields in PA_CONFIG register are set explicitly, so there is no need to read this register first. Suggested-by: Andreas Sandberg <andreas@sandberg.pp.se> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
parent
8d332adf1a
commit
d1ba1ca5a5
1 changed files with 0 additions and 10 deletions
|
@ -231,22 +231,12 @@ void SX1276SetRfTxPower(int8_t power)
|
|||
uint8_t pa_config = 0;
|
||||
uint8_t pa_dac = 0;
|
||||
|
||||
ret = sx1276_read(SX1276_REG_PA_CONFIG, &pa_config, 1);
|
||||
if (ret < 0) {
|
||||
LOG_ERR("Unable to read PA config");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = sx1276_read(SX1276_REG_PA_DAC, &pa_dac, 1);
|
||||
if (ret < 0) {
|
||||
LOG_ERR("Unable to read PA dac");
|
||||
return;
|
||||
}
|
||||
|
||||
pa_config &= RF_PACONFIG_MAX_POWER_MASK;
|
||||
pa_config &= RF_PACONFIG_OUTPUTPOWER_MASK;
|
||||
pa_config &= RF_PACONFIG_PASELECT_MASK;
|
||||
|
||||
pa_dac &= RF_PADAC_20DBM_MASK;
|
||||
|
||||
#if defined CONFIG_PA_BOOST_PIN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue