mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-23 15:27:28 +02:00
fix(esp_modem): Use default UART CLK source
Some targets don't support UART_SCLK_APB (e.g. esp32c2) This change is applicable only for IDFv5.0 and later, as older version didn't define UART_SCLK_DEFAULT. Closes https://github.com/espressif/esp-protocols/issues/241
This commit is contained in:
@ -84,6 +84,11 @@ struct esp_modem_dte_config {
|
||||
};
|
||||
};
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
#define ESP_MODEM_DEFAULT_UART_CLK UART_SCLK_DEFAULT
|
||||
#else
|
||||
#define ESP_MODEM_DEFAULT_UART_CLK UART_SCLK_APB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief ESP Modem DTE Default Configuration
|
||||
@ -100,7 +105,7 @@ struct esp_modem_dte_config {
|
||||
.stop_bits = UART_STOP_BITS_1, \
|
||||
.parity = UART_PARITY_DISABLE, \
|
||||
.flow_control = ESP_MODEM_FLOW_CONTROL_NONE,\
|
||||
.source_clk = UART_SCLK_APB, \
|
||||
.source_clk = ESP_MODEM_DEFAULT_UART_CLK, \
|
||||
.baud_rate = 115200, \
|
||||
.tx_io_num = 25, \
|
||||
.rx_io_num = 26, \
|
||||
|
Reference in New Issue
Block a user