diff --git a/device/src/keyboard/oled/screens/screen_manager.c b/device/src/keyboard/oled/screens/screen_manager.c index 8c79d9d3..97c41841 100644 --- a/device/src/keyboard/oled/screens/screen_manager.c +++ b/device/src/keyboard/oled/screens/screen_manager.c @@ -11,11 +11,14 @@ screen_id_t ActiveScreen = ScreenId_Main; +bool InteractivePairingInProgress = false; + static void onExit(screen_id_t screen) { switch(screen) { case ScreenId_Pairing: + InteractivePairingInProgress = false; Ledmap_ResetTemporaryLedBacklightingMode(); - Ledmap_UpdateBacklightLeds(); + EventVector_Set(EventVector_LedManagerFullUpdateNeeded); break; default: break; @@ -30,8 +33,10 @@ void ScreenManager_ActivateScreen(screen_id_t screen) switch(screen) { case ScreenId_Pairing: + InteractivePairingInProgress = true; screenPtr = PairingScreen; Ledmap_SetTemporaryLedBacklightingMode(BacklightingMode_Numpad); + EventVector_Set(EventVector_LedManagerFullUpdateNeeded); Ledmap_UpdateBacklightLeds(); break; case ScreenId_Debug: diff --git a/device/src/keyboard/oled/screens/screen_manager.h b/device/src/keyboard/oled/screens/screen_manager.h index 4e8be73c..a440dce8 100644 --- a/device/src/keyboard/oled/screens/screen_manager.h +++ b/device/src/keyboard/oled/screens/screen_manager.h @@ -27,6 +27,8 @@ extern bool ScreenManager_AwaitsInput; extern screen_id_t ActiveScreen; + extern bool InteractivePairingInProgress; + // Functions: void ScreenManager_ActivateScreen(screen_id_t screen); diff --git a/right/src/led_manager.c b/right/src/led_manager.c index 0f286c08..46f409bc 100644 --- a/right/src/led_manager.c +++ b/right/src/led_manager.c @@ -18,6 +18,12 @@ #include "device.h" #endif +#if DEVICE_IS_UHK80_RIGHT +#include "keyboard/oled/screens/screen_manager.h" +#else +#define InteractivePairingInProgress false; +#endif + bool KeyBacklightSleepModeActive = false; bool DisplaySleepModeActive = false; @@ -27,7 +33,7 @@ uint8_t KeyBacklightBrightness = 0xff; static void recalculateLedBrightness() { bool globalSleepMode = !Cfg.LedsEnabled || CurrentPowerMode > PowerMode_Awake || Cfg.LedBrightnessMultiplier == 0.0f; - bool globalAlwaysOn = Cfg.LedsAlwaysOn || Ledmap_AlwaysOn; + bool globalAlwaysOn = Cfg.LedsAlwaysOn || Ledmap_AlwaysOn || InteractivePairingInProgress; if (!globalAlwaysOn && (globalSleepMode || KeyBacklightSleepModeActive)) { KeyBacklightBrightness = 0;