summaryrefslogtreecommitdiff
path: root/keyboards/mechlovin/hannah60rgb
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/mechlovin/hannah60rgb')
-rw-r--r--keyboards/mechlovin/hannah60rgb/rev1/config.h3
-rw-r--r--keyboards/mechlovin/hannah60rgb/rev1/rev1.c31
-rw-r--r--keyboards/mechlovin/hannah60rgb/rev2/config.h3
-rw-r--r--keyboards/mechlovin/hannah60rgb/rev2/rev2.c56
4 files changed, 50 insertions, 43 deletions
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index 9a84e78588..bf8172b994 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -2,11 +2,10 @@
#define RGB_DI_PIN A15
#ifdef RGB_MATRIX_ENABLE
-# define DRIVER_LED_TOTAL 72
+# define RGB_MATRIX_LED_COUNT 72
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
-# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
// # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/rev1.c b/keyboards/mechlovin/hannah60rgb/rev1/rev1.c
index 6b1b8604a2..b61ac10b14 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/rev1.c
+++ b/keyboards/mechlovin/hannah60rgb/rev1/rev1.c
@@ -27,21 +27,26 @@ led_config_t g_led_config = { {
}, {
//LED Index to Physical Positon
{ 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0 }, { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {208, 0}, {216, 0},
- {220, 0}, {211, 16}, {200,16 }, {176,16 }, {160,16}, {144,16}, {128,16}, { 112,16}, { 96,16}, { 80,16}, { 64,16}, { 48,16}, {32, 16}, {16, 16}, {0,16},
- { 0, 32}, { 16, 32}, { 32,32 }, { 48,32 }, { 64,32}, { 80,32}, { 96,32}, { 112,32}, { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {208, 32}, {224,48},
- {208, 48}, {192, 48}, {160,48 }, {144,48 }, {128,48}, {112,48}, {96,48}, { 80,48}, { 64,48}, { 48,48}, { 32,48}, { 16,48}, {8, 48}, {0, 48}, {0,48},
- { 0, 64}, { 16, 64}, { 32,64 }, { 48,64 }, { 64,64}, { 80,64}, { 96,64}, { 112,64}, { 144,64}, { 160,64}, { 192,64}, { 224,64},
+ {220, 0}, {211, 16}, {200,16 }, {176,16 }, {160,16}, {144,16}, {128,16}, { 112,16}, { 96,16}, { 80,16}, { 64,16}, { 48,16}, {32, 16}, {16, 16}, {0,16},
+ { 0, 32}, { 16, 32}, { 32,32 }, { 48,32 }, { 64,32}, { 80,32}, { 96,32}, { 112,32}, { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {208, 32}, {224,48},
+ {208, 48}, {192, 48}, {160,48 }, {144,48 }, {128,48}, {112,48}, {96,48}, { 80,48}, { 64,48}, { 48,48}, { 32,48}, { 16,48}, {8, 48}, {0, 48}, {0,48},
+ { 0, 64}, { 16, 64}, { 32,64 }, { 48,64 }, { 64,64}, { 80,64}, { 96,64}, { 112,64}, { 144,64}, { 160,64}, { 192,64}, { 224,64},
}, {
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,
} };
-void rgb_matrix_indicators_user(void) {
- if (host_keyboard_led_state().caps_lock) {
- rgb_matrix_set_color(30, 255, 255, 255);
- }
+bool rgb_matrix_indicators_kb(void) {
+ if (!rgb_matrix_indicators_user()) {
+ return false;
+ }
+
+ if (host_keyboard_led_state().caps_lock) {
+ rgb_matrix_set_color(30, 255, 255, 255);
+ }
+ return true;
}
-#endif \ No newline at end of file
+#endif
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
index 3a25680a20..2dab887e4d 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -21,11 +21,10 @@
#define DRIVER_COUNT 2
#define DRIVER_1_LED_TOTAL 44
#define DRIVER_2_LED_TOTAL 34
-#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
+#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
-#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
// #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
index ac371e4185..a2812aa41d 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
@@ -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))