From ecf09382dae98a61f0de15f9ea44602005ee50ac Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Thu, 14 Nov 2019 11:44:21 +0530 Subject: [PATCH] uart: critical section compliant API in ISR context --- components/driver/uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/uart.c b/components/driver/uart.c index ebb6d0f1b..4fc5d00e0 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -413,7 +413,7 @@ static esp_err_t UART_ISR_ATTR uart_pattern_enqueue(uart_port_t uart_num, int po { UART_CHECK((p_uart_obj[uart_num]), "uart driver error", ESP_FAIL); esp_err_t ret = ESP_OK; - UART_ENTER_CRITICAL(&uart_spinlock[uart_num]); + UART_ENTER_CRITICAL_ISR(&uart_spinlock[uart_num]); uart_pat_rb_t *p_pos = &p_uart_obj[uart_num]->rx_pattern_pos; int next = p_pos->wr + 1; if (next >= p_pos->len) { @@ -427,7 +427,7 @@ static esp_err_t UART_ISR_ATTR uart_pattern_enqueue(uart_port_t uart_num, int po p_pos->wr = next; ret = ESP_OK; } - UART_EXIT_CRITICAL(&uart_spinlock[uart_num]); + UART_EXIT_CRITICAL_ISR(&uart_spinlock[uart_num]); return ret; }