diff options
author | Wilba <wilba@wilba.tech> | 2022-09-24 09:39:55 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 19:39:55 -0400 |
commit | 2791ceb6aa000bce07638ad117a73eba4df0e3f6 (patch) | |
tree | cd8bbfaceec77e29f5ae17b12f0a8338822b3cbf | |
parent | 03a671e7953844d085deba313d9e7de3c5a84105 (diff) | |
download | qmk_firmware-2791ceb6aa000bce07638ad117a73eba4df0e3f6.tar.gz qmk_firmware-2791ceb6aa000bce07638ad117a73eba4df0e3f6.zip |
Add caps lock and scroll lock indicators (#17725)
-rw-r--r-- | keyboards/wilba_tech/wt60_a/config.h | 4 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt65_a/config.h | 3 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt65_b/config.h | 3 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt75_b/config.h | 3 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt75_c/config.h | 3 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt80_a/config.h | 3 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt_mono_backlight.c | 27 |
7 files changed, 44 insertions, 2 deletions
diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 8bd0e08508..c2b85fee76 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -100,8 +100,8 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 -// enable the RGB indicator for WT75-A -#define MONO_BACKLIGHT_WT75_A +// enable the specific indicators +#define MONO_BACKLIGHT_WT60_A // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index 5a03ec52c1..062e2d8564 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -100,6 +100,9 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 +// enable the specific indicators +#define MONO_BACKLIGHT_WT65_A + // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt65_b/config.h b/keyboards/wilba_tech/wt65_b/config.h index 426a0b824b..8320daef0a 100644 --- a/keyboards/wilba_tech/wt65_b/config.h +++ b/keyboards/wilba_tech/wt65_b/config.h @@ -100,6 +100,9 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 +// enable the specific indicators +#define MONO_BACKLIGHT_WT65_B + // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt75_b/config.h b/keyboards/wilba_tech/wt75_b/config.h index d7abac199e..98b3d937f9 100644 --- a/keyboards/wilba_tech/wt75_b/config.h +++ b/keyboards/wilba_tech/wt75_b/config.h @@ -100,6 +100,9 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 +// enable the specific indicators +#define MONO_BACKLIGHT_WT75_B + // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt75_c/config.h b/keyboards/wilba_tech/wt75_c/config.h index 8562e8e18a..d8cf5a1a95 100644 --- a/keyboards/wilba_tech/wt75_c/config.h +++ b/keyboards/wilba_tech/wt75_c/config.h @@ -100,6 +100,9 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 +// enable the specific indicators +#define MONO_BACKLIGHT_WT75_C + // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index f9708ab33b..2bc81b2fa5 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -100,6 +100,9 @@ // enable the mono backlight #define MONO_BACKLIGHT_ENABLED 1 +// enable the specific indicators +#define MONO_BACKLIGHT_WT80_A + // disable backlight when USB suspended (PC sleep/hibernate/shutdown) #define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index 5e2fde810c..71bf8e0284 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -173,6 +173,33 @@ void backlight_effect_indicators(void) IS31FL3736_mono_set_brightness(63, rgb.g); IS31FL3736_mono_set_brightness(71, rgb.b); #endif // MONO_BACKLIGHT_WT75_A + +// This pairs with "All Off" already setting zero brightness, +// and "All On" already setting non-zero brightness. +#if defined(MONO_BACKLIGHT_WT60_A) || \ +defined(MONO_BACKLIGHT_WT65_A) || \ +defined(MONO_BACKLIGHT_WT65_B) || \ +defined(MONO_BACKLIGHT_WT75_A) || \ +defined(MONO_BACKLIGHT_WT75_B) || \ +defined(MONO_BACKLIGHT_WT75_C) || \ +defined(MONO_BACKLIGHT_WT80_A) + if ( g_indicator_state & (1<<USB_LED_CAPS_LOCK) ) { + // Caps Lock: D1 -> (4*8+0) + IS31FL3736_mono_set_brightness(32, 255); + } +#endif +#if defined(MONO_BACKLIGHT_WT80_A) + if ( g_indicator_state & (1<<USB_LED_SCROLL_LOCK) ) { + // Scroll Lock: G7 -> (6*8+6) + IS31FL3736_mono_set_brightness(54, 255); + } +#endif +#if defined(MONO_BACKLIGHT_WT75_C) + if ( g_indicator_state & (1<<USB_LED_SCROLL_LOCK) ) { + // Scroll Lock: G8 -> (6*8+7) + IS31FL3736_mono_set_brightness(55, 255); + } +#endif } ISR(TIMER3_COMPA_vect) |