diff options
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 5d8ffe34e..c1829c768 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -1448,6 +1448,24 @@ void led_set(uint8_t usb_led) | |||
| 1448 | // PORTE &= ~(1<<6); | 1448 | // PORTE &= ~(1<<6); |
| 1449 | // } | 1449 | // } |
| 1450 | 1450 | ||
| 1451 | #if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE) | ||
| 1452 | // Use backlight as Caps Lock indicator | ||
| 1453 | uint8_t bl_toggle_lvl = 0; | ||
| 1454 | |||
| 1455 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK) && !backlight_config.enable) { | ||
| 1456 | // Turning Caps Lock ON and backlight is disabled in config | ||
| 1457 | // Toggling backlight to the brightest level | ||
| 1458 | bl_toggle_lvl = BACKLIGHT_LEVELS; | ||
| 1459 | } else if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK) && backlight_config.enable) { | ||
| 1460 | // Turning Caps Lock OFF and backlight is enabled in config | ||
| 1461 | // Toggling backlight and restoring config level | ||
| 1462 | bl_toggle_lvl = backlight_config.level; | ||
| 1463 | } | ||
| 1464 | |||
| 1465 | // Set level without modify backlight_config to keep ability to restore state | ||
| 1466 | backlight_set(bl_toggle_lvl); | ||
| 1467 | #endif | ||
| 1468 | |||
| 1451 | led_set_kb(usb_led); | 1469 | led_set_kb(usb_led); |
| 1452 | } | 1470 | } |
| 1453 | 1471 | ||
