From 36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 23 Sep 2022 22:46:23 +1000 Subject: Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399) --- keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/mechlovin/hannah60rgb/rev2/rev2.c') diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c index ac371e4185..bb88a316ea 100644 --- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c +++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c @@ -17,7 +17,7 @@ #include "rev2.h" #ifdef RGB_MATRIX_ENABLE -const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location -- cgit v1.2.3 From 64b1ed45507a15d5594b1f90b936c2096918f5a4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 4 Oct 2022 15:24:22 -0700 Subject: Fix Per Key LED Indicator Callbacks (#18450) Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> Co-authored-by: Nick Brassel --- keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 54 ++++++++++++++++------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'keyboards/mechlovin/hannah60rgb/rev2/rev2.c') diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c index bb88a316ea..a2812aa41d 100644 --- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c +++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c @@ -123,8 +123,8 @@ led_config_t g_led_config = { { { 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0}, //9-59-68-76 { 0, 16}, { 16, 16}, { 32, 16}, { 48, 16}, //10-60-72-77 { 0, 32}, { 16, 32}, { 32, 32}, { 48, 32}, //46-61-73-78 - { 0, 48}, { 0, 48}, { 12, 48}, { 16, 48}, //126-51-63-74 - { 0, 64}, { 16, 64}, //56-67 + { 0, 48}, { 0, 48}, { 12, 48}, { 16, 48}, //126-51-63-74 + { 0, 64}, { 16, 64}, //56-67 { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, //80-84-89-94 { 64, 16}, { 80, 16}, { 96,16}, { 112,16}, //81-85-90-95 { 64, 32}, { 80, 32}, { 96,32}, { 112,32}, //82-86-91-96 @@ -133,34 +133,38 @@ led_config_t g_led_config = { { { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {220, 0}, {210, 0}, //98-102-106-111-116-121-130 { 128,16}, {144,16}, {160,16}, {176, 16}, {192, 16}, {220, 16}, {220,16}, //99-103-107-112-117-129-122 { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {220, 32}, //100-104-108-113-118-123 - { 96,48}, {112,48}, {128, 48}, {144, 48}, {160, 48}, {200, 48}, {220,48}, {220,48}, //97-101-105-109-114-119-128-124 + { 96,48}, {112,48}, {128, 48}, {144, 48}, {160, 48}, {200, 48}, {220,48}, {220,48}, //97-101-105-109-114-119-128-124 { 96,64}, {144,64}, {160,64}, {176,64}, {220, 64}, //127-110-115-120-125 - { 220, 0}, //140 + { 220, 0}, //140 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, } }; -__attribute__((weak)) void rgb_matrix_indicators_user(void) { - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color(8, 255, 255, 255); - rgb_matrix_set_color(70, 255, 0, 0); - } else { - rgb_matrix_set_color(70, 0, 0, 0); - } - if (host_keyboard_led_state().num_lock) { - rgb_matrix_set_color(71, 255, 0, 0); - } else { - rgb_matrix_set_color(71, 0, 0, 0); - } - if (host_keyboard_led_state().scroll_lock) { - rgb_matrix_set_color(72, 255, 0, 0); - } else { - rgb_matrix_set_color(72, 0, 0, 0); - } +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(8, 255, 255, 255); + rgb_matrix_set_color(70, 255, 0, 0); + } else { + rgb_matrix_set_color(70, 0, 0, 0); + } + if (host_keyboard_led_state().num_lock) { + rgb_matrix_set_color(71, 255, 0, 0); + } else { + rgb_matrix_set_color(71, 0, 0, 0); + } + if (host_keyboard_led_state().scroll_lock) { + rgb_matrix_set_color(72, 255, 0, 0); + } else { + rgb_matrix_set_color(72, 0, 0, 0); + } + return true; } __attribute__((weak)) -- cgit v1.2.3 From 20ed138236a88c8b1fc3924f4b883618f6e01920 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 11 Nov 2022 12:15:19 +1100 Subject: LED config fixes (#18973) --- keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 78 +++++++++++++++++------------ 1 file changed, 46 insertions(+), 32 deletions(-) (limited to 'keyboards/mechlovin/hannah60rgb/rev2/rev2.c') diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c index a2812aa41d..e8b1c89f32 100644 --- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c +++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c @@ -110,39 +110,53 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, C9_16, C9_11, C7_12},//INDICATOR LED-77 }; -led_config_t g_led_config = { { - // Key Matrix to LED Index - {0, 1, 2, 3, 18, 19, 20, 21, 36, 37, 38, 39, 40, 41}, - {4, 5, 6, 7, 22, 23, 24, 25, 43, 44, 45, 46, 47, 69}, - {8, 9, 10, 11, 26, 27, 28, 29, 50, 51, 52, 53, 54, 55}, - {13, 14, 15, 30, 31, 32, 33, 56, 57, 58, 59, 60, 62, 63}, - {16, 17, 34, NO_LED, NO_LED, NO_LED, 35, NO_LED, NO_LED, NO_LED, 65, 66, 67, 68}, - }, +led_config_t g_led_config = { { - //LED Index to Physical Positon - { 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0}, //9-59-68-76 - { 0, 16}, { 16, 16}, { 32, 16}, { 48, 16}, //10-60-72-77 - { 0, 32}, { 16, 32}, { 32, 32}, { 48, 32}, //46-61-73-78 - { 0, 48}, { 0, 48}, { 12, 48}, { 16, 48}, //126-51-63-74 - { 0, 64}, { 16, 64}, //56-67 - { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, //80-84-89-94 - { 64, 16}, { 80, 16}, { 96,16}, { 112,16}, //81-85-90-95 - { 64, 32}, { 80, 32}, { 96,32}, { 112,32}, //82-86-91-96 - { 32, 48}, { 48, 48}, { 64,48}, { 80,48}, //79-83-87-92 - { 32, 64}, { 80, 64}, //75-93 - { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {220, 0}, {210, 0}, //98-102-106-111-116-121-130 - { 128,16}, {144,16}, {160,16}, {176, 16}, {192, 16}, {220, 16}, {220,16}, //99-103-107-112-117-129-122 - { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {220, 32}, //100-104-108-113-118-123 - { 96,48}, {112,48}, {128, 48}, {144, 48}, {160, 48}, {200, 48}, {220,48}, {220,48}, //97-101-105-109-114-119-128-124 - { 96,64}, {144,64}, {160,64}, {176,64}, {220, 64}, //127-110-115-120-125 - { 220, 0}, //140 -}, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -} }; + // Key Matrix to LED Index + { 0, 1, 2, 3, 18, 19, 20, 21, 36, 37, 38, 39, 40, 41 }, + { 4, 5, 6, 7, 22, 23, 24, 25, 43, 44, 45, 46, 47, 69 }, + { 8, 9, 10, 11, 26, 27, 28, 29, 50, 51, 52, 53, 54, 55 }, + { 13, 14, 15, 30, 31, 32, 33, 56, 57, 58, 59, 60, 62, 63 }, + { 16, 17, 34, NO_LED, NO_LED, NO_LED, 35, NO_LED, NO_LED, NO_LED, 65, 66, 67, 68 } + }, { + //LED Index to Physical Positon + { 0, 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, //9-59-68-76 + { 0, 16 }, { 16, 16 }, { 32, 16 }, { 48, 16 }, //10-60-72-77 + { 0, 32 }, { 16, 32 }, { 32, 32 }, { 48, 32 }, //46-61-73-78 + { 0, 48 }, { 0, 48 }, { 12, 48 }, { 16, 48 }, //126-51-63-74 + { 0, 64 }, { 16, 64 }, //56-67 + { 64, 0 }, { 80, 0 }, { 96, 0 }, { 112, 0 }, //80-84-89-94 + { 64, 16 }, { 80, 16 }, { 96, 16 }, { 112, 16 }, //81-85-90-95 + { 64, 32 }, { 80, 32 }, { 96, 32 }, { 112, 32 }, //82-86-91-96 + { 32, 48 }, { 48, 48 }, { 64, 48 }, { 80, 48 }, //79-83-87-92 + { 32, 64 }, { 80, 64 }, //75-93 + { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 220, 0 }, { 210, 0 }, //98-102-106-111-116-121-130 + { 128, 16 }, { 144, 16 }, { 160, 16 }, { 176, 16 }, { 192, 16 }, { 220, 16 }, { 220, 16 }, //99-103-107-112-117-129-122 + { 128, 32 }, { 144, 32 }, { 160, 32 }, { 176, 32 }, { 192, 32 }, { 220, 32 }, //100-104-108-113-118-123 + { 96, 48 }, { 112, 48 }, { 128, 48 }, { 144, 48 }, { 160, 48 }, { 200, 48 }, { 220, 48 }, { 220, 48 }, //97-101-105-109-114-119-128-124 + { 96, 64 }, { 144, 64 }, { 160, 64 }, { 176, 64 }, { 220, 64 }, //127-110-115-120-125 + { 220, 0 }, //140 + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } + }, { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, + 9, 9, 9, 9, 9, 9, 9, 9 + } +}; bool rgb_matrix_indicators_kb(void) { if (!rgb_matrix_indicators_user()) { -- cgit v1.2.3