Skip to content

Commit

Permalink
Merge branch 'bugfix/uart_cannot_work_if_upgrade_from_v2.0' into 'mas…
Browse files Browse the repository at this point in the history
…ter'

fix(ESPAT-1934): Fixed that uart cannot work if upgrades from v2.0 to v3.3

See merge request application/esp-at!1523
  • Loading branch information
xcguang committed Feb 21, 2024
2 parents 50b25ce + 6efc64d commit 8393a6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main/interface/uart/at_uart_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ esp_err_t at_mfg_uart_port_pins_get(at_uart_port_pins_t *config)
config->rts_pin = CONFIG_AT_UART_PORT_RTS_PIN_DEFAULT;

// get uart port and uart pins from flash
int8_t uart_num;
int8_t uart_num = g_at_cmd_port;
int32_t tx_pin, rx_pin, cts_pin, rts_pin;
at_mfg_params_storage_mode_t mode = at_get_mfg_params_storage_mode();
if (mode == AT_PARAMS_IN_MFG_NVS) {
Expand Down Expand Up @@ -193,7 +193,9 @@ esp_err_t at_mfg_uart_port_pins_get(at_uart_port_pins_t *config)
return ESP_FAIL;
}
// uart configurations are stored in the 12nd to 19th bytes of the partition
uart_num = data[5];
if (data[5] != 0xFF) {
uart_num = data[5];
}
if (data[16] != 0xFF && data[17] != 0xFF) {
tx_pin = data[16];
rx_pin = data[17];
Expand Down

0 comments on commit 8393a6e

Please sign in to comment.