static void IRAM_ATTR gpio_isr_handle(void* arg)
{
uint32_t gpio_num = (uint32_t)arg;
xQueueSendFromISR(gpio_pen_queue,&gpio_num,NULL);
GPIO.pin[GPIO_PEN_SDA_IO].int_ena = 0; ///关闭中断
}
static void gpio_task_example(void* arg)
{
uint32_t io_num;
for(;;) {
if(xQueueReceive(gpio_pen_queue, &io_num, portMAX_DELAY)) {
printf("GPIO[%d] intr, val: %d\n", io_num, gpio_get_level(io_num));
// GPIO.status_w1tc=1<<GPIO_PEN_SDA_IO;
// GPIO.pin[GPIO_PEN_SDA_IO].int_type = GPIO_INTR_NEGEDGE;
// GPIO.pin[GPIO_PEN_SDA_IO].int_ena = 1; ///开启中断
gpio_set_intr_type(GPIO_PEN_SDA_IO, GPIO_INTR_NEGEDGE);
gpio_intr_enable(GPIO_PEN_SDA_IO);
}
}
}
再中断中失能中断,线程中开启中断。中断不响应问题
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Who is online
Users browsing this forum: No registered users and 187 guests