diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-07 18:22:46 -0500 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-07 16:22:46 -0700 |
commit | af89752bffbaf5dcea30ea16be66b4d682701bc4 (patch) | |
tree | c82f2bc25409159a44778379db8b3a35afc47b8a /keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | |
parent | c7f8548d9af2045996294602d2a4bd9a214ae23c (diff) | |
download | qmk_firmware-af89752bffbaf5dcea30ea16be66b4d682701bc4.tar.gz qmk_firmware-af89752bffbaf5dcea30ea16be66b4d682701bc4.zip |
rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783)
* Initial conversion of the rgb_led struct
* Converting last keyboard & updating effects to take advantage of the new structure
* New struct should not be const
* Updated docs
* Changing define ___ for no led to NO_LED
* Missed converting some keymap usages of the old struct layout
Diffstat (limited to 'keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c')
-rw-r--r-- | keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 3dfa783744..a6d1e226bd 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -50,40 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool default_layer) -{ - rgb_led led; - - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { - rgb_matrix_set_color( i, red, green, blue ); - } - } +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } } void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); - + if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - + case _LAYER2: rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - + case _LAYER4: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; } } - + if (this_led & (1 << USB_LED_CAPS_LOCK)) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } - + switch (biton32(layer_state)) { case _LAYER3: if (this_led & (1 << USB_LED_NUM_LOCK)) { @@ -91,7 +87,7 @@ void rgb_matrix_indicators_user(void) } else { rgb_matrix_set_color(13, 0x00, 0x00, 0x00); } - + rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); rgb_matrix_set_color(1, 0x00, 0x00, 0x00); rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); |