Skip to content

Commit 8169e17

Browse files
committed
Move automatic LDRO enforcement to sx126x component, update to sx126x driver v0.1.0
1 parent bdda8be commit 8169e17

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ dependencies:
99
- if: target == esp32p4
1010
version: ">=2.12.3"
1111
nicolaielectronics/sx126x:
12-
version: "^0.0.3"
12+
version: "^0.1.0"
1313
license: "MIT"

lora.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ static esp_err_t lora_radio_apply_config(lora_handle_t* handle, const lora_proto
773773
return ESP_ERR_INVALID_ARG;
774774
}
775775

776-
res = sx126x_set_modulation_params_lora(&handle->driver_handle, spreading_factor, bandwidth, coding_rate,
776+
res = sx126x_set_modulation_params_lora(&handle->driver_handle, spreading_factor, bandwidth, coding_rate, true,
777777
config_params->low_data_rate_optimization);
778778
if (res != ESP_OK) {
779779
ESP_LOGE(TAG, "Failed to set LoRa modulation parameters: %s", esp_err_to_name(res));
@@ -910,12 +910,6 @@ esp_err_t lora_set_config(lora_handle_t* handle, const lora_protocol_config_para
910910
}
911911
} else {
912912
memcpy(&handle->lora_config, config, sizeof(lora_protocol_config_params_t));
913-
914-
// Auto-enforce LDRO per SX126x datasheet: required when symbol duration > 16ms
915-
// T_sym_ms = 2^SF / BW_kHz. Threshold: 2^SF / BW_kHz > 16 → 2^SF > 16 * BW_kHz
916-
if (((uint32_t)(1U << config->spreading_factor) > 16U * config->bandwidth)) {
917-
handle->lora_config.low_data_rate_optimization = true;
918-
}
919913
return lora_radio_apply_config(handle, config);
920914
}
921915
return ESP_OK;

0 commit comments

Comments
 (0)