mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user