From 4a74e3d02d585ff099c5f900eb05ce3c16c985d7 Mon Sep 17 00:00:00 2001 From: Wilba Date: Thu, 13 Oct 2022 18:14:58 +1100 Subject: Fix Caps Lock indicators on Wilba Tech PCBs (#18695) --- keyboards/wilba_tech/wt_main.c | 8 -------- keyboards/wilba_tech/wt_mono_backlight.c | 24 ++++++++++-------------- keyboards/wilba_tech/wt_mono_backlight.h | 1 - keyboards/wilba_tech/wt_rgb_backlight.c | 9 +-------- keyboards/wilba_tech/wt_rgb_backlight.h | 1 - 5 files changed, 11 insertions(+), 32 deletions(-) (limited to 'keyboards') diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index a7afeb5907..bc1a1d3c87 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -115,14 +115,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) return process_record_user(keycode, record); } -void led_set_kb(uint8_t usb_led) -{ -#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED - backlight_set_indicator_state(usb_led); -#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED - led_set_user(usb_led); -} - void suspend_power_down_kb(void) { #if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index 71bf8e0284..0fc6e346a1 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -53,7 +53,6 @@ backlight_config g_config = { }; bool g_suspend_state = false; -uint8_t g_indicator_state = 0; // Global tick at 20 Hz uint32_t g_tick = 0; @@ -118,11 +117,6 @@ void backlight_set_suspend_state(bool state) g_suspend_state = state; } -void backlight_set_indicator_state(uint8_t state) -{ - g_indicator_state = state; -} - void backlight_set_brightness_all( uint8_t value ) { IS31FL3736_mono_set_brightness_all( value ); @@ -168,7 +162,9 @@ void backlight_effect_indicators(void) #if defined(MONO_BACKLIGHT_WT75_A) HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; RGB rgb = hsv_to_rgb( hsv ); - // G8, H8, I8 -> (6*8+7) (7*8+7), (8*8+7) + // SW7,CS8 = (6*8+7) = 55 + // SW8,CS8 = (7*8+7) = 63 + // SW9,CS8 = (8*8+7) = 71 IS31FL3736_mono_set_brightness(55, rgb.r); IS31FL3736_mono_set_brightness(63, rgb.g); IS31FL3736_mono_set_brightness(71, rgb.b); @@ -183,20 +179,20 @@ 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< (4*8+0) - IS31FL3736_mono_set_brightness(32, 255); + if ( host_keyboard_led_state().caps_lock ) { + // SW3,CS1 = (2*8+0) = 16 + IS31FL3736_mono_set_brightness(16, 255); } #endif #if defined(MONO_BACKLIGHT_WT80_A) - if ( g_indicator_state & (1< (6*8+6) + if ( host_keyboard_led_state().scroll_lock ) { + // SW7,CS7 = (6*8+6) = 54 IS31FL3736_mono_set_brightness(54, 255); } #endif #if defined(MONO_BACKLIGHT_WT75_C) - if ( g_indicator_state & (1< (6*8+7) + if ( host_keyboard_led_state().scroll_lock ) { + // SW7,CS8 = (6*8+7) = 55 IS31FL3736_mono_set_brightness(55, 255); } #endif diff --git a/keyboards/wilba_tech/wt_mono_backlight.h b/keyboards/wilba_tech/wt_mono_backlight.h index 2f913d2cb6..88183fd847 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.h +++ b/keyboards/wilba_tech/wt_mono_backlight.h @@ -56,7 +56,6 @@ void backlight_timer_enable(void); void backlight_timer_disable(void); void backlight_set_suspend_state(bool state); -void backlight_set_indicator_state(uint8_t state); // This should not be called from an interrupt // (eg. from a timer interrupt). diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c index a696fe7ed4..af4b84c5cf 100644 --- a/keyboards/wilba_tech/wt_rgb_backlight.c +++ b/keyboards/wilba_tech/wt_rgb_backlight.c @@ -144,7 +144,6 @@ backlight_config g_config = { }; bool g_suspend_state = false; -uint8_t g_indicator_state = 0; // Global tick at 20 Hz uint32_t g_tick = 0; @@ -1982,11 +1981,6 @@ void backlight_set_suspend_state(bool state) g_suspend_state = state; } -void backlight_set_indicator_state(uint8_t state) -{ - g_indicator_state = state; -} - void backlight_effect_rgb_test(void) { // Mask out bits 4 and 5 @@ -2425,8 +2419,7 @@ void backlight_effect_indicators_set_colors( uint8_t index, HS color ) // colors already set void backlight_effect_indicators(void) { - if ( g_config.caps_lock_indicator.index != 255 && - ( g_indicator_state & (1<