Remove redundant checks for power of 0 (#2934)

* Add comment explaining necessity for second 0 check

Thank you @GUVWAF

* Update RF95Interface.cpp

* Update STM32WLE5JCInterface.cpp

* Update SX126xInterface.cpp

* Update SX128xInterface.cpp

* remove whitespace...

* Update SX128xInterface.cpp
This commit is contained in:
S5NC
2023-11-13 12:19:02 +00:00
committed by GitHub
parent 590b0bbff4
commit 0b9accc3b6
5 changed files with 5 additions and 11 deletions

View File

@@ -448,7 +448,9 @@ void RadioInterface::applyModemConfig()
power = myRegion->powerLimit;
if (power == 0)
power = 17; // Default to default power if we don't have a valid power
power = 17; // Default to this power level if we don't have a valid regional power limit (powerLimit of myRegion defaults
// to 0, currently no region has an actual power limit of 0 [dBm] so we can assume regions which have this
// variable set to 0 don't have a valid power limit)
// Set final tx_power back onto config
loraConfig.tx_power = (int8_t)power; // cppcheck-suppress assignmentAddressToInteger
@@ -546,4 +548,4 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p)
sendingPacket = p;
return p->encrypted.size + sizeof(PacketHeader);
}
}