mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(touch): fixed touch read WDT issue on esp32
Closes https://github.com/espressif/esp-idf/issues/15629
This commit is contained in:
@ -362,11 +362,15 @@ static esp_err_t _touch_pad_read(touch_pad_t touch_num, uint16_t *touch_value, t
|
|||||||
if (TOUCH_FSM_MODE_SW == mode) {
|
if (TOUCH_FSM_MODE_SW == mode) {
|
||||||
touch_pad_set_group_mask((1 << touch_num), (1 << touch_num), (1 << touch_num));
|
touch_pad_set_group_mask((1 << touch_num), (1 << touch_num), (1 << touch_num));
|
||||||
touch_pad_sw_start();
|
touch_pad_sw_start();
|
||||||
while (!touch_hal_meas_is_done()) {};
|
while (!touch_hal_meas_is_done()) {
|
||||||
|
vTaskDelay(1);
|
||||||
|
}
|
||||||
*touch_value = touch_hal_read_raw_data(touch_num);
|
*touch_value = touch_hal_read_raw_data(touch_num);
|
||||||
touch_pad_clear_group_mask((1 << touch_num), (1 << touch_num), (1 << touch_num));
|
touch_pad_clear_group_mask((1 << touch_num), (1 << touch_num), (1 << touch_num));
|
||||||
} else if (TOUCH_FSM_MODE_TIMER == mode) {
|
} else if (TOUCH_FSM_MODE_TIMER == mode) {
|
||||||
while (!touch_hal_meas_is_done()) {};
|
while (!touch_hal_meas_is_done()) {
|
||||||
|
vTaskDelay(1);
|
||||||
|
}
|
||||||
*touch_value = touch_hal_read_raw_data(touch_num);
|
*touch_value = touch_hal_read_raw_data(touch_num);
|
||||||
} else {
|
} else {
|
||||||
res = ESP_FAIL;
|
res = ESP_FAIL;
|
||||||
|
Reference in New Issue
Block a user