1#include <freertos/FreeRTOS.h>
2#include <driver/gpio.h>
3#include "esp_lcd_touch_gt911.h"
9static TaskHandle_t touch_task_handle;
11static void IRAM_ATTR gt911_isr_handler(
void *arg)
13 BaseType_t xHigherPriorityTaskWoken = pdFALSE;
14 vTaskNotifyGiveFromISR(touch_task_handle, &xHigherPriorityTaskWoken);
15 if (xHigherPriorityTaskWoken) portYIELD_FROM_ISR();
18static void touch_task(
void *arg)
20 esp_lcd_touch_handle_t tp_handle = (esp_lcd_touch_handle_t)arg;
22 gpio_install_isr_service(0);
23 gpio_isr_handler_add(GPIO_NUM_4, gt911_isr_handler, NULL);
27 ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
31 if (!gpio_get_level(GPIO_NUM_4))
32 esp_lcd_touch_read_data(tp_handle);
#define xTaskCreatePinnedToCore(task_func, name, stack, param, priority, handle, core_id)
SemaphoreHandle_t i2c_mutex
#define I2C_MASTER_TIMEOUT_MS
void init_touch_task(esp_lcd_touch_handle_t tp_handle)