mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
uart: fix threshold configuration loss when interrupts are disabled
This commit is contained in:
committed by
Song Ruo Jing
parent
501471bf79
commit
f12a7d627a
@@ -2105,9 +2105,7 @@ esp_err_t uart_set_rx_full_threshold(uart_port_t uart_num, int threshold)
|
|||||||
return ESP_ERR_INVALID_STATE;
|
return ESP_ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||||
if (uart_hal_get_intr_ena_status(&(uart_context[uart_num].hal)) & UART_INTR_RXFIFO_FULL) {
|
uart_hal_set_rxfifo_full_thr(&(uart_context[uart_num].hal), threshold);
|
||||||
uart_hal_set_rxfifo_full_thr(&(uart_context[uart_num].hal), threshold);
|
|
||||||
}
|
|
||||||
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
|
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
@@ -2122,9 +2120,7 @@ esp_err_t uart_set_tx_empty_threshold(uart_port_t uart_num, int threshold)
|
|||||||
return ESP_ERR_INVALID_STATE;
|
return ESP_ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||||
if (uart_hal_get_intr_ena_status(&(uart_context[uart_num].hal)) & UART_INTR_TXFIFO_EMPTY) {
|
uart_hal_set_txfifo_empty_thr(&(uart_context[uart_num].hal), threshold);
|
||||||
uart_hal_set_txfifo_empty_thr(&(uart_context[uart_num].hal), threshold);
|
|
||||||
}
|
|
||||||
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
|
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user