clear gpio event queue to help debounce
This commit is contained in:
parent
365a91ad0d
commit
e8bc3f39b4
|
@ -33,6 +33,8 @@ static void gpio_task(void* arg) {
|
||||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ble_send_notification((void*)&off, 1);
|
ble_send_notification((void*)&off, 1);
|
||||||
|
|
||||||
|
xQueueReset(gpio_evt_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +50,7 @@ void user_button_init() {
|
||||||
|
|
||||||
gpio_config(&io_conf);
|
gpio_config(&io_conf);
|
||||||
|
|
||||||
gpio_evt_queue = xQueueCreate(10, sizeof(uint32_t));
|
gpio_evt_queue = xQueueCreate(1, sizeof(uint32_t));
|
||||||
xTaskCreate(gpio_task, "gpio_task", 4096, NULL, 10, NULL);
|
xTaskCreate(gpio_task, "gpio_task", 4096, NULL, 10, NULL);
|
||||||
|
|
||||||
gpio_install_isr_service(0);
|
gpio_install_isr_service(0);
|
||||||
|
|
Loading…
Reference in New Issue