fix(esp32p4): P4 touch channel 14 failure fix

Merges https://github.com/espressif/esp-idf/pull/17759

Core dump when using all touch channels on a P4 unless curr_chan is allowed to be 14
This commit is contained in:
Pete Kabaragoya
2025-10-28 10:36:37 +08:00
committed by laokaiyao
parent b6370af474
commit 450ee3366d
2 changed files with 5 additions and 5 deletions
@@ -64,6 +64,10 @@ void IRAM_ATTR touch_priv_default_intr_handler(void *arg)
touch_base_event_data_t data;
touch_ll_get_active_channel_mask(&data.status_mask);
int ch_offset = touch_ll_get_current_meas_channel() - TOUCH_MIN_CHAN_ID;
if (ch_offset < 0 || ch_offset >= (int)SOC_MODULE_ATTR(TOUCH, CHAN_NUM)) {
/* Not a valid channel */
return;
}
data.chan = g_touch->ch[ch_offset];
/* If the channel is not registered, return directly */
if (!data.chan) {