mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-29 22:24:26 +00:00 
			
		
		
		
	[esp32_touch] Work around ESP-IDF v5.4 regression in touch_pad_read_filtered()
This commit is contained in:
		| @@ -201,15 +201,13 @@ void IRAM_ATTR ESP32TouchComponent::touch_isr_handler(void *arg) { | ||||
|     touch_pad_t pad = child->get_touch_pad(); | ||||
|  | ||||
|     // Read current value using ISR-safe API | ||||
|     uint32_t value; | ||||
|     if (component->iir_filter_enabled_()) { | ||||
|       uint16_t temp_value = 0; | ||||
|       touch_pad_read_filtered(pad, &temp_value); | ||||
|       value = temp_value; | ||||
|     } else { | ||||
|       // Use low-level HAL function when filter is not enabled | ||||
|       value = touch_ll_read_raw_data(pad); | ||||
|     } | ||||
|     // IMPORTANT: ESP-IDF v5.4 regression - touch_pad_read_filtered() is no longer ISR-safe | ||||
|     // In v5.3 and earlier it was ISR-safe, but v5.4 added mutex protection that causes: | ||||
|     // "assert failed: xQueueSemaphoreTake queue.c:1718" | ||||
|     // We must use raw values even when filter is enabled as a workaround. | ||||
|     // Users should adjust thresholds to compensate for the lack of IIR filtering. | ||||
|     // See: https://github.com/espressif/esp-idf/issues/17045 | ||||
|     uint32_t value = touch_ll_read_raw_data(pad); | ||||
|  | ||||
|     // Skip pads that aren’t in the trigger mask | ||||
|     if (((mask >> pad) & 1) == 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user