summaryrefslogtreecommitdiff
path: root/users/drashna/rgb_stuff.c
diff options
context:
space:
mode:
authorWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
committerWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
commit71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (patch)
tree3bb3e5e496621535611e087720aa5c4d7a533e5e /users/drashna/rgb_stuff.c
parent86ad4988fe7ff64916127509d84f44c56fa097aa (diff)
parentda1f05fbc19477c05c0c01bb07fabfaf1ece9d54 (diff)
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'users/drashna/rgb_stuff.c')
-rw-r--r--users/drashna/rgb_stuff.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 38e86ae0ea..7d364fa686 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -5,8 +5,6 @@
#if defined(RGBLIGHT_ENABLE)
extern rgblight_config_t rgblight_config;
bool has_initialized;
-#elif defined(RGB_MATRIX_ENABLE)
-extern rgb_config_t rgb_matrix_config;
#endif
#ifdef RGBLIGHT_ENABLE
@@ -277,7 +275,7 @@ void matrix_scan_rgb(void) {
}
-uint32_t layer_state_set_rgb(uint32_t state) {
+layer_state_t layer_state_set_rgb(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) {
switch (biton32(state)) {
@@ -336,3 +334,14 @@ uint32_t layer_state_set_rgb(uint32_t state) {
return state;
}
+
+#ifdef RGB_MATRIX_ENABLE
+extern led_config_t g_led_config;
+void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) {
+ for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
+ rgb_matrix_set_color( i, red, green, blue );
+ }
+ }
+}
+#endif