diff --git a/firmware/src/animation_engine.cpp b/firmware/src/animation_engine.cpp index de8a934..5b9058e 100644 --- a/firmware/src/animation_engine.cpp +++ b/firmware/src/animation_engine.cpp @@ -117,10 +117,16 @@ static void animTickTask(void* pvParams) { TickType_t lastWake = xTaskGetTickCount(); while (true) { - // Drain commandQueue — process ALL pending commands before this frame + // Drain commandQueue — process ALL pending commands before this frame. + // Guard against NULL: commandQueue is only created in startUdpServer(), + // which is called only after WiFi connects. If WiFi never connects (e.g. + // wrong credentials, no AP) commandQueue stays NULL and xQueueReceive() + // would panic. Skip queue drain safely until UDP server is up. LedCommand cmd; - while (xQueueReceive(commandQueue, &cmd, 0) == pdTRUE) { - applyCommand(cmd); + if (commandQueue != NULL) { + while (xQueueReceive(commandQueue, &cmd, 0) == pdTRUE) { + applyCommand(cmd); + } } // Tick Schrank (WS2801, RGB, 160 LEDs, isRGBW=false) diff --git a/firmware/src/led_driver.h b/firmware/src/led_driver.h index 88e2840..ea5c7a9 100644 --- a/firmware/src/led_driver.h +++ b/firmware/src/led_driver.h @@ -3,9 +3,12 @@ #include "config.h" // SK6812: RGBW (4 bytes/LED) — MUST use NeoGrbwFeature, never NeoRgbFeature +// NeoEsp32RmtNWs2812xMethod uses RMT channel N (0-indexed). +// On ESP32-C3 (RISC-V single-core), only RMT channels 0 and 1 are available. +// NeoEsp32Rmt0Ws2812xMethod = channel 0, pinned to PIN_SK6812 at runtime. using StripWand = NeoPixelBus; // WS2801: RGB (3 bytes/LED), 2MHz SPI for cable-safe 5m run -using StripSchrank = NeoPixelBus; +using StripSchrank = NeoPixelBus; extern StripWand stripWand; extern StripSchrank stripSchrank;