[+] Update thread

This commit is contained in:
Hykilpikonna
2023-04-28 18:22:26 -04:00
parent 2258b7db6e
commit 22cae349e7
+17
View File
@@ -13,6 +13,7 @@ class KeyboardLights
private:
Adafruit_NeoPixel led_key;
std::unordered_map<int, int> 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();
}
}
};