From 47053c9a7e29e5423c14923c215af1a95ebd66e6 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 18 Aug 2019 16:12:02 +0200 Subject: [PATCH] LEDPaletteTheme: Fix the key address refreshAt() uses In `refreshAt()`, we want to use the key address, instead of the LED address. `LEDControl` will turn the key address into a LED address itself anyway. This not only makes the code a tiny bit more efficient, but it also fixes `refreshAt()`, which was refreshing the wrong key since the conversion to `KeyAddr`. Signed-off-by: Gergely Nagy --- src/kaleidoscope/plugin/LED-Palette-Theme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kaleidoscope/plugin/LED-Palette-Theme.cpp b/src/kaleidoscope/plugin/LED-Palette-Theme.cpp index 4611125f..42e9c8dd 100644 --- a/src/kaleidoscope/plugin/LED-Palette-Theme.cpp +++ b/src/kaleidoscope/plugin/LED-Palette-Theme.cpp @@ -51,7 +51,7 @@ void LEDPaletteTheme::refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_ uint8_t pos = KeyboardHardware.getLedIndex(key_addr); cRGB color = lookupColorAtPosition(map_base, pos); - ::LEDControl.setCrgbAt(KeyAddr(pos), color); + ::LEDControl.setCrgbAt(key_addr, color); }