diff options
author | uvok | 2025-08-02 20:27:13 +0200 |
---|---|---|
committer | uvok | 2025-08-02 20:27:13 +0200 |
commit | f1a61e7b72bc081c7e1f8c6274fb46327b73f923 (patch) | |
tree | ddc1225333d236b468c8a6efee09503895e4be31 | |
parent | eedacb5674246179df0fd48ca910b6f9369f7c81 (diff) |
gpio: Fix init order
I had a task which accessed an uninit queue.
oops.
-rw-r--r-- | src/gpio.cpp | 6 |
1 files 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; |