fix(touch): fix hw_ver1 read data check

Closes https://github.com/espressif/esp-idf/issues/18811
This commit is contained in:
Hu Rui
2026-07-10 14:56:10 +08:00
parent 41582e1777
commit c629c200a9

View File

@@ -249,7 +249,7 @@ esp_err_t touch_priv_channel_read_data(touch_channel_handle_t chan_handle, touch
{
ESP_RETURN_ON_FALSE_ISR(type >= TOUCH_CHAN_DATA_TYPE_RAW && type <= TOUCH_CHAN_DATA_TYPE_SMOOTH,
ESP_ERR_INVALID_ARG, TAG, "The channel data type is invalid");
ESP_RETURN_ON_FALSE_ISR(type == TOUCH_CHAN_DATA_TYPE_SMOOTH && chan_handle->base->data_filter_fn != NULL,
ESP_RETURN_ON_FALSE_ISR(type != TOUCH_CHAN_DATA_TYPE_SMOOTH || chan_handle->base->data_filter_fn != NULL,
ESP_ERR_INVALID_STATE, TAG, "The software filter has not configured");
TOUCH_ENTER_CRITICAL_SAFE(TOUCH_PERIPH_LOCK);
switch (type) {