Sfoglia il codice sorgente

esp32_port: set uart clock source as default

Closes https://github.com/espressif/esp-idf/issues/9041
Erhan Kurubas 3 anni fa
parent
commit
09fee7ad96
2 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 1 1
      idf_component.yml
  2. 5 1
      port/esp32_port.c

+ 1 - 1
idf_component.yml

@@ -1,3 +1,3 @@
-version: "0.0.3"
+version: "0.0.4"
 description: Serial flasher component provides portable library for flashing Espressif SoCs from other host microcontroller
 url: https://github.com/espressif/esp-serial-flasher

+ 5 - 1
port/esp32_port.c

@@ -18,6 +18,7 @@
 #include "driver/gpio.h"
 #include "esp_timer.h"
 #include "esp_log.h"
+#include "esp_idf_version.h"
 #include <unistd.h>
 
 // #define SERIAL_DEBUG_ENABLE
@@ -75,7 +76,10 @@ esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config)
         .data_bits = UART_DATA_8_BITS,
         .parity    = UART_PARITY_DISABLE,
         .stop_bits = UART_STOP_BITS_1,
-        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE
+        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
+        .source_clk = UART_SCLK_DEFAULT,
+#endif
     };
 
     int rx_buffer_size = config->rx_buffer_size ? config->rx_buffer_size : 400;