Skip to content

Commit

Permalink
Add caps lock and scroll lock indicators (#17725)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilba authored Sep 23, 2022
1 parent 03a671e commit 2791ceb
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keyboards/wilba_tech/wt60_a/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions keyboards/wilba_tech/wt65_a/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions keyboards/wilba_tech/wt65_b/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions keyboards/wilba_tech/wt75_b/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions keyboards/wilba_tech/wt75_c/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions keyboards/wilba_tech/wt80_a/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions keyboards/wilba_tech/wt_mono_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2791ceb

Please sign in to comment.