diff --git a/right/src/keymap.c b/right/src/keymap.c index 851bc09..d936f81 100644 --- a/right/src/keymap.c +++ b/right/src/keymap.c @@ -18,7 +18,7 @@ void SwitchKeymap(uint8_t index) CurrentKeymapIndex = index; ValidatedUserConfigBuffer.offset = AllKeymaps[index].offset; ParseKeymap(&ValidatedUserConfigBuffer, index, AllKeymapsCount, AllMacrosCount); - LedDisplay_SetText(AllKeymaps[index].abbreviationLen, AllKeymaps[index].abbreviation); + LedDisplay_SetCurrentKeymapText(); } // The factory keymap is initialized before it gets overwritten by the default keymap of the EEPROM. diff --git a/right/src/led_display.c b/right/src/led_display.c index 3678d59..25a048f 100644 --- a/right/src/led_display.c +++ b/right/src/led_display.c @@ -1,6 +1,7 @@ #include "led_display.h" #include "slave_drivers/is31fl3731_driver.h" #include "layer.h" +#include "keymap.h" static const uint16_t capitalLetterToSegmentSet[] = { 0b0000000011110111, @@ -78,6 +79,12 @@ void LedDisplay_SetText(uint8_t length, const char* text) { } } +void LedDisplay_SetCurrentKeymapText(void) +{ + keymap_reference_t *currentKeymap = AllKeymaps + CurrentKeymapIndex; + LedDisplay_SetText(currentKeymap->abbreviationLen, currentKeymap->abbreviation); +} + void LedDisplay_SetLayer(uint8_t layerId) { for (uint8_t i = 13; i <= 45; i += 16) { LedDriverValues[LedDriverId_Left][i] = 0; diff --git a/right/src/led_display.h b/right/src/led_display.h index bd49f95..48c53cb 100644 --- a/right/src/led_display.h +++ b/right/src/led_display.h @@ -17,6 +17,7 @@ // Functions: void LedDisplay_SetText(uint8_t length, const char* text); + void LedDisplay_SetCurrentKeymapText(void); void LedDisplay_SetLayer(uint8_t layerId); void LedDisplay_SetIcon(led_display_icon_t icon, bool isEnabled); diff --git a/right/src/slave_drivers/is31fl3731_driver.c b/right/src/slave_drivers/is31fl3731_driver.c index c8bba17..f3eea84 100644 --- a/right/src/slave_drivers/is31fl3731_driver.c +++ b/right/src/slave_drivers/is31fl3731_driver.c @@ -70,10 +70,9 @@ void LedSlaveDriver_Init(uint8_t ledDriverId) { currentLedDriverState->phase = LedDriverPhase_SetFunctionFrame; currentLedDriverState->ledIndex = 0; memset(LedDriverValues[ledDriverId], LED_BRIGHTNESS_LEVEL, LED_DRIVER_LED_COUNT); - LedDisplay_SetText(3, "FTY"); + LedDisplay_SetCurrentKeymapText(); } - status_t LedSlaveDriver_Update(uint8_t ledDriverId) { status_t status = kStatus_Uhk_IdleSlave; uint8_t *ledValues = LedDriverValues[ledDriverId];