From afb8064a29cda5384ef7d2dc1d221ff07632e0f9 Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni Date: Tue, 24 Dec 2019 14:14:09 +0530 Subject: [PATCH] esp32/rtc_module: Fixed critical section API Application used to abort as portENTER_CRITICAL is used in ISR. portENTER_CRITICAL is changed to portENTER_CRITICAL_SAFE in touch_pad_clear_status() https://github.com/aws/amazon-freertos/issues/1651 --- components/driver/rtc_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/rtc_module.c b/components/driver/rtc_module.c index d36acc6db..c07eb2ecb 100644 --- a/components/driver/rtc_module.c +++ b/components/driver/rtc_module.c @@ -785,9 +785,9 @@ uint32_t IRAM_ATTR touch_pad_get_status() esp_err_t IRAM_ATTR touch_pad_clear_status() { - portENTER_CRITICAL(&rtc_spinlock); + portENTER_CRITICAL_SAFE(&rtc_spinlock); SENS.sar_touch_ctrl2.touch_meas_en_clr = 1; - portEXIT_CRITICAL(&rtc_spinlock); + portEXIT_CRITICAL_SAFE(&rtc_spinlock); return ESP_OK; }