clear gpio event queue to help debounce

This commit is contained in:
Morgan 'ARR\!' Allen 2020-10-29 11:17:43 -07:00
parent 365a91ad0d
commit e8bc3f39b4

View file

@ -33,6 +33,8 @@ static void gpio_task(void* arg) {
vTaskDelay(500 / portTICK_PERIOD_MS);
ble_send_notification((void*)&off, 1);
xQueueReset(gpio_evt_queue);
}
}
}
@ -48,7 +50,7 @@ void user_button_init() {
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);
gpio_install_isr_service(0);