Skip to content

Commit f09ab67

Browse files
authored
Merge pull request #6740 from kivaisan/fix_max_tx_power
Lora: Fix max tx power check
2 parents b47a305 + e9eb32b commit f09ab67

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

features/lorawan/lorastack/phy/LoRaPHY.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,7 @@ bool LoRaPHY::tx_config(tx_config_params_t* tx_conf, int8_t* tx_power,
883883
band_t *bands = (band_t *)phy_params.bands.table;
884884

885885
// limit TX power if set to too much
886-
if (tx_conf->tx_power > bands[band_idx].max_tx_pwr) {
887-
tx_conf->tx_power = bands[band_idx].max_tx_pwr;
888-
}
886+
tx_conf->tx_power = MAX(tx_conf->tx_power, bands[band_idx].max_tx_pwr);
889887

890888
uint8_t bandwidth = get_bandwidth(tx_conf->datarate);
891889
int8_t phy_tx_power = 0;

0 commit comments

Comments
 (0)