mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
uart: fixed sclk_freq not init warning when compiling with asserts disabled
Closes https://github.com/espressif/esp-idf/issues/9642
This commit is contained in:
parent
8e361d3df0
commit
b844df8c85
@ -303,8 +303,7 @@ esp_err_t uart_set_baudrate(uart_port_t uart_num, uint32_t baud_rate)
|
||||
uint32_t sclk_freq;
|
||||
|
||||
uart_hal_get_sclk(&(uart_context[uart_num].hal), &src_clk);
|
||||
esp_err_t err = uart_get_sclk_freq(src_clk, &sclk_freq);
|
||||
assert(err == ESP_OK);
|
||||
ESP_RETURN_ON_ERROR(uart_get_sclk_freq(src_clk, &sclk_freq), UART_TAG, "Invalid src_clk");
|
||||
|
||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||
uart_hal_set_baudrate(&(uart_context[uart_num].hal), baud_rate, sclk_freq);
|
||||
@ -320,8 +319,7 @@ esp_err_t uart_get_baudrate(uart_port_t uart_num, uint32_t *baudrate)
|
||||
uint32_t sclk_freq;
|
||||
|
||||
uart_hal_get_sclk(&(uart_context[uart_num].hal), &src_clk);
|
||||
esp_err_t err = uart_get_sclk_freq(src_clk, &sclk_freq);
|
||||
assert(err == ESP_OK);
|
||||
ESP_RETURN_ON_ERROR(uart_get_sclk_freq(src_clk, &sclk_freq), UART_TAG, "Invalid src_clk");
|
||||
|
||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||
uart_hal_get_baudrate(&(uart_context[uart_num].hal), baudrate, sclk_freq);
|
||||
@ -747,8 +745,7 @@ esp_err_t uart_param_config(uart_port_t uart_num, const uart_config_t *uart_conf
|
||||
}
|
||||
#endif
|
||||
uint32_t sclk_freq;
|
||||
esp_err_t err = uart_get_sclk_freq(uart_config->source_clk, &sclk_freq);
|
||||
assert(err == ESP_OK);
|
||||
ESP_RETURN_ON_ERROR(uart_get_sclk_freq(uart_config->source_clk, &sclk_freq), UART_TAG, "Invalid src_clk");
|
||||
|
||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||
uart_hal_init(&(uart_context[uart_num].hal), uart_num);
|
||||
|
@ -0,0 +1,2 @@
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
Loading…
x
Reference in New Issue
Block a user