summaryrefslogtreecommitdiff
path: root/src/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/main.cpp')
-rw-r--r--src/main/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp
index d283b01d..685e1fc1 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -20,6 +20,10 @@ extern "C" void app_main(void) {
ESP_ERROR_CHECK(drivers::init_i2c());
drivers::Gpios* gpios = system_fsm::SystemState::early_init_gpios();
+ // Semaphores must be empty before being added to a queue set. Hence all this
+ // weird early init stuff; by being explicit about initialisation order, we're
+ // able to handle GPIO ISR notifcations + system events from the same task,
+ // and a little mess with worth not needing to allocate a whole extra stack.
QueueSetHandle_t set = xQueueCreateSet(2);
auto* event_queue = events::queues::SystemAndAudio();
xQueueAddToSet(event_queue->has_events(), set);