summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
index 5cfd28a..debb71b 100644
--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
+++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
@@ -513,12 +513,14 @@ static int parse_SX1301_configuration(const char * conf_file) {
return -1;
}
- val = json_object_get_value(conf_obj, "max_tx_power"); /* fetch value (if possible) */
- if (json_value_get_type(val) == JSONNumber && (uint8_t)json_value_get_number(val) <= 32) {
- boardconf.max_tx_power = (uint8_t)json_value_get_number(val);
- } else {
- MSG("WARNING: Data for max_tx_power is invalid, must be an integer (0-32)\n");
- boardconf.max_tx_power = 32;
+ if (fpga_supports_attenuator()) {
+ val = json_object_get_value(conf_obj, "max_tx_power"); /* fetch value (if possible) */
+ if (json_value_get_type(val) == JSONNumber) {
+ boardconf.max_tx_power = (uint8_t)json_value_get_number(val);
+ } else {
+ MSG("WARNING: Data for max_tx_power is invalid, must be an integer\n");
+ boardconf.max_tx_power = 32;
+ }
}
/* set LBT configuration */