diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-10 18:55:02 -0500 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-10 16:55:02 -0700 |
commit | 62ba66d61821fec6a5ad3bdccdf738e15e082461 (patch) | |
tree | 4b0fb100299a7a7e9a51cbbe96da94df8a57483f /keyboards/dztech/dz60rgb | |
parent | febaf9dec42ce4d4ade316f811145a291137ee94 (diff) |
Cleanup/rgb matrix (#5811)
* clean up rgb matrix extern usage
Moved rgb matrix boiler plate into macros
Rebased onto typing heatmap pr
* Fixing the reversed frame buffer access in digital rain
* Fixing digital rain & typing heatmap if keyreactive effects are not enabled
* Apply suggestions from code review
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Adding parenthesizes to DRIVER_LED_TOTAL where necessary
* Updated docs
* added notes about parentheses
Diffstat (limited to 'keyboards/dztech/dz60rgb')
7 files changed, 1 insertions, 14 deletions
diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index 584f035ef4..8633b1836a 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 @@ -38,7 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -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)) { diff --git a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c index c0bc1b89b1..464d92e023 100644 --- a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 5a7a56801a..091343ac38 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 @@ -39,7 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -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)) { diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 34c1752ffa..bc8a6fa36e 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 @@ -39,7 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS), }; -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)) { diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index 3a90d2f335..61a3a22864 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 @@ -38,7 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -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)) { diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c index 5c725f5dcc..600ac86192 100644 --- a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; enum dz60rgb_layers { _QWERTY, @@ -26,7 +25,6 @@ enum dz60rgb_keycodes { #define _V_V_V_ KC_TRNS #define LT_CAPS LT(_NAV, KC_CAPS) #define LT_DEL LT(_RGB, KC_DEL) -extern rgb_config_t rgb_matrix_config; extern bool autoshift_enabled; #define MT_SLSH RSFT_T(KC_SLSH) #define MT_APP RALT_T(KC_APP) diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index a6d1e226bd..a7f1dd73e2 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -extern bool g_suspend_state; #define _LAYER0 0 #define _LAYER1 1 #define _LAYER2 2 @@ -50,8 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -extern led_config_t g_led_config; -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { 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 ); |