From f1a61e7b72bc081c7e1f8c6274fb46327b73f923 Mon Sep 17 00:00:00 2001 From: uvok Date: Sat, 2 Aug 2025 20:27:13 +0200 Subject: gpio: Fix init order I had a task which accessed an uninit queue. oops. --- src/gpio.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpio.cpp b/src/gpio.cpp index b7b03f1..0d852b9 100644 --- a/src/gpio.cpp +++ b/src/gpio.cpp @@ -54,8 +54,6 @@ static void gpio_loop(void *); //! Create task, initialize pins... void de::uvok::badge::gpio_init(void) { - xTaskCreateStatic(gpio_loop, "gpio", GPIO_STACK, NULL, configMAX_PRIORITIES - 1, gpio_task_stuff.task_stack, - &gpio_task_stuff.task); gpio_task_stuff.queue_handle = xQueueCreateStatic(4, sizeof(pin_notification_t), &(gpio_task_stuff.queue_storage[0]), &gpio_task_stuff.queue); #if UVOK_EPAP_BOARD == BOARD_ESP32_CROWPANEL @@ -68,6 +66,10 @@ void de::uvok::badge::gpio_init(void) inputs[p].last_level = digitalRead(p); } #endif + + // ** TASK AFTER QUEUE ** !!! + xTaskCreateStatic(gpio_loop, "gpio", GPIO_STACK, NULL, configMAX_PRIORITIES - 1, gpio_task_stuff.task_stack, + &gpio_task_stuff.task); } static volatile uint32_t event; -- cgit v1.2.3