diff --git a/firmware/src/keyboard_lights.cpp b/firmware/src/keyboard_lights.cpp index 2e195a7..c1a6427 100644 --- a/firmware/src/keyboard_lights.cpp +++ b/firmware/src/keyboard_lights.cpp @@ -13,6 +13,7 @@ class KeyboardLights private: Adafruit_NeoPixel led_key; std::unordered_map key_to_light; + TaskHandle_t thread{}; public: KeyboardLights() : led_key(LK_NUM_LIGHTS, LK_PIN, NEO_GRB + NEO_KHZ800) @@ -44,6 +45,7 @@ public: void begin() { led_key.begin(); + xTaskCreate(loop, "loopLights", 4096, this, 1, &thread); } void hit(int key) @@ -58,4 +60,19 @@ public: led_key.show(); } + + void update() + { + + } + + [[noreturn]] static void loop(void *pv) + { + auto *lights = (KeyboardLights *) pv; + + while (true) + { + lights->update(); + } + } }; \ No newline at end of file