You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If pw is 16, it will pass through unchanged, but then the mask with 0xF will cause bits 3..0 of RegPaConfig to be set to zero instead of the desired 0xF.
if pw is 2..15, it will be written to RegPaConfig, but since bit 7 is also set, the output power is interpreted as 17-(15-OutputPower) [or OutputPower + 2]. So pw == 2 sets output power = 4 dBm; pw == 15 or >= 17 sets 17 dBm; and pw == 16 sets 0 dBm.
It would be best to revise this code along with the fixes for #46 so that we can handle PaSelect == 0; in that case MaxPower should be set based on the region's maximum output power, allowing finest control and then OutputPower would be adjusted within the resulting range. (We could get as low as -4.2 dBm.)
The text was updated successfully, but these errors were encountered:
This code looks wrong.
arduino-lmic/src/lmic/radio.c
Lines 426 to 435 in 896fb80
pw
is 16, it will pass through unchanged, but then the mask with 0xF will cause bits 3..0 of RegPaConfig to be set to zero instead of the desired 0xF.pw
is 2..15, it will be written to RegPaConfig, but since bit 7 is also set, the output power is interpreted as 17-(15-OutputPower) [or OutputPower + 2]. Sopw
== 2 sets output power = 4 dBm;pw
== 15 or >= 17 sets 17 dBm; andpw
== 16 sets 0 dBm.It would be best to revise this code along with the fixes for #46 so that we can handle PaSelect == 0; in that case MaxPower should be set based on the region's maximum output power, allowing finest control and then OutputPower would be adjusted within the resulting range. (We could get as low as -4.2 dBm.)
The text was updated successfully, but these errors were encountered: