manuelbl / ttn-esp32

The Things Network device library for ESP32 (ESP-IDF) and SX127x based devices
MIT License
308 stars 63 forks source link

fix configPower for sx1272 #55

Closed FrancoLiberali closed 2 years ago

FrancoLiberali commented 2 years ago

The function configPower is not compiling when using CFG_sx1272_radio. The error is the following:

ttn-esp32/src/lmic/radio.c: In function 'configPower':
ttn-esp32/src/lmic/radio.c:673:15: error: 'eff_pw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     } else if (eff_pw >= 14) {
               ^
cc1: some warnings being treated as errors

To fix it, I followed the logic that I saw it is executed when using CFG_sx1276_radio, where the value of eff_pw depends of req_pw and no of its own value.