mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Fix impossible check in uart_set_line_inverse
This commit is contained in:
parent
d3703ba80f
commit
8e89a136e1
@ -191,7 +191,7 @@ esp_err_t uart_get_baudrate(uart_port_t uart_num, uint32_t* baudrate)
|
||||
esp_err_t uart_set_line_inverse(uart_port_t uart_num, uint32_t inverse_mask)
|
||||
{
|
||||
UART_CHECK((uart_num < UART_NUM_MAX), "uart_num error", ESP_FAIL);
|
||||
UART_CHECK((((inverse_mask & UART_LINE_INV_MASK) == 0) && (inverse_mask != 0)), "inverse_mask error", ESP_FAIL);
|
||||
UART_CHECK((((inverse_mask & ~UART_LINE_INV_MASK) == 0) && (inverse_mask != 0)), "inverse_mask error", ESP_FAIL);
|
||||
UART_ENTER_CRITICAL(&uart_spinlock[uart_num]);
|
||||
CLEAR_PERI_REG_MASK(UART_CONF0_REG(uart_num), UART_LINE_INV_MASK);
|
||||
SET_PERI_REG_MASK(UART_CONF0_REG(uart_num), inverse_mask);
|
||||
|
Loading…
x
Reference in New Issue
Block a user