mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
fix(touch): checks if the timer is active before stopping it
Merges https://github.com/espressif/esp-idf/pull/10745
This commit is contained in:
parent
2ec93b3394
commit
e6fb6612c9
@ -512,7 +512,9 @@ esp_err_t touch_pad_filter_delete(void)
|
||||
esp_err_t ret = ESP_OK;
|
||||
xSemaphoreTake(rtc_touch_mux, portMAX_DELAY);
|
||||
if (s_touch_pad_filter->timer) {
|
||||
ESP_GOTO_ON_ERROR(esp_timer_stop(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to stop the timer");
|
||||
if (esp_timer_is_active(s_touch_pad_filter->timer)) {
|
||||
ESP_GOTO_ON_ERROR(esp_timer_stop(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to stop the timer");
|
||||
}
|
||||
ESP_GOTO_ON_ERROR(esp_timer_delete(s_touch_pad_filter->timer), err, TOUCH_TAG, "failed to delete the timer");
|
||||
s_touch_pad_filter->timer = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user