espressif/esp-iot-solution

esp32 S3 BOX 按键触发回调函数后,怎么实现触发任务的执行 (AEGHB-592)

huangdiajd opened this issue · 1 comments

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

这是我的按键回调
static void button_single_click_cb(void *arg){
uint32_t gpio_num = (uint32_t) arg;
if(key==false)
{
xEventGroupSetBits(lora_work_handle,lora_work_BIT_0);
// xSemaphoreGive(semp_handle);

    ESP_LOGI(TAG, "BTN%ld:REC START!!!!!!!\n", gpio_num);
    key = true;
//     int datatoque = 1;
//    // xTaskCreatePinnedToCore(LORA_TX_WORK_Task,"LORA_TX_WORK_Task",1024*10,NULL,4,&TX_WORK_handle,1);
//    xQueueSend(quq_handle,&datatoque,portMAX_DELAY);
}

}
我想实现按下按键,执行任务。但是目前我使用设置事件组标志位来处理,发现它是会触发事件组断言。请问,有没有好的方法可以实现回调触发任务的执行吗?

看起来这段代码的事件组设置没用问题,请确定事件组在使用前已经被初始化了,如果可以,请贴上你的报错 log