diff options
| author | HorrorTroll <sonicvipduc@gmail.com> | 2023-04-03 05:24:04 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-03 08:24:04 +1000 |
| commit | d3008110096db2ac098db9b5cb47ad77582c01d9 (patch) | |
| tree | f31fa3ba7481f3621faec10e87ab4eef2fdf9e50 | |
| parent | 27e6e27d3a2ff9d91bcf0f189cdc39509bef0335 (diff) | |
Add user horrortroll in userspace (#19769)
37 files changed, 258 insertions, 1280 deletions
diff --git a/keyboards/gopolar/gg86/gg86.c b/keyboards/gopolar/gg86/gg86.c index 3e790cd61e..814ee5ec3e 100644 --- a/keyboards/gopolar/gg86/gg86.c +++ b/keyboards/gopolar/gg86/gg86.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 Gopolar | 1 | /* Copyright 2023 Gopolar |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -20,6 +20,11 @@ | |||
| 20 | #include "lib/logo.h" | 20 | #include "lib/logo.h" |
| 21 | 21 | ||
| 22 | #ifdef RGB_MATRIX_ENABLE | 22 | #ifdef RGB_MATRIX_ENABLE |
| 23 | |||
| 24 | #include <string.h> | ||
| 25 | #include <math.h> | ||
| 26 | #include <lib/lib8tion/lib8tion.h> | ||
| 27 | |||
| 23 | led_config_t g_led_config = { { | 28 | led_config_t g_led_config = { { |
| 24 | { 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, NO_LED, 74, 73, 72 }, | 29 | { 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, NO_LED, 74, 73, 72 }, |
| 25 | { 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 }, | 30 | { 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 }, |
| @@ -50,6 +55,62 @@ led_config_t g_led_config = { { | |||
| 50 | // Underglow (88 -> 99) | 55 | // Underglow (88 -> 99) |
| 51 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 | 56 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 |
| 52 | } }; | 57 | } }; |
| 58 | |||
| 59 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 60 | switch (keycode) { | ||
| 61 | case RGB_TOG: | ||
| 62 | if (record->event.pressed) { | ||
| 63 | switch (rgb_matrix_get_flags()) { | ||
| 64 | case LED_FLAG_ALL: { | ||
| 65 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 66 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 67 | } | ||
| 68 | break; | ||
| 69 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 70 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 71 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 72 | } | ||
| 73 | break; | ||
| 74 | case (LED_FLAG_UNDERGLOW): { | ||
| 75 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 76 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 77 | } | ||
| 78 | break; | ||
| 79 | default: { | ||
| 80 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 81 | rgb_matrix_enable_noeeprom(); | ||
| 82 | } | ||
| 83 | break; | ||
| 84 | } | ||
| 85 | } | ||
| 86 | return false; | ||
| 87 | } | ||
| 88 | return process_record_user(keycode, record); | ||
| 89 | } | ||
| 90 | |||
| 91 | bool rgb_matrix_indicators_kb(void) { | ||
| 92 | if (!rgb_matrix_indicators_user()) { | ||
| 93 | return false; | ||
| 94 | } | ||
| 95 | |||
| 96 | HSV hsv = rgb_matrix_config.hsv; | ||
| 97 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 98 | hsv.h = time; | ||
| 99 | RGB rgb = hsv_to_rgb(hsv); | ||
| 100 | |||
| 101 | if (host_keyboard_led_state().caps_lock) { | ||
| 102 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 103 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 104 | rgb_matrix_set_color(25, 0, 0, 0); | ||
| 105 | } | ||
| 106 | |||
| 107 | if (host_keyboard_led_state().scroll_lock) { | ||
| 108 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 109 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 110 | rgb_matrix_set_color(73, 0, 0, 0); | ||
| 111 | } | ||
| 112 | return true; | ||
| 113 | } | ||
| 53 | #endif | 114 | #endif |
| 54 | 115 | ||
| 55 | #ifdef OLED_ENABLE | 116 | #ifdef OLED_ENABLE |
diff --git a/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c b/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c index 454d346f18..e0c17f868a 100644 --- a/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c +++ b/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -19,11 +19,6 @@ | |||
| 19 | // OLED animation | 19 | // OLED animation |
| 20 | #include "oled/bongocat.h" | 20 | #include "oled/bongocat.h" |
| 21 | 21 | ||
| 22 | #include <string.h> | ||
| 23 | #include <math.h> | ||
| 24 | |||
| 25 | #include <lib/lib8tion/lib8tion.h> | ||
| 26 | |||
| 27 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 22 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
| 28 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 23 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
| 29 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | 24 | // Layer names don't all need to be of the same length, obviously, and you can also skip them |
| @@ -34,22 +29,6 @@ enum layer_names { | |||
| 34 | _FN, | 29 | _FN, |
| 35 | }; | 30 | }; |
| 36 | 31 | ||
| 37 | enum user_rgb_mode { | ||
| 38 | RGB_MODE_ALL, | ||
| 39 | RGB_MODE_KEYLIGHT, | ||
| 40 | RGB_MODE_UNDERGLOW, | ||
| 41 | RGB_MODE_NONE, | ||
| 42 | }; | ||
| 43 | |||
| 44 | typedef union { | ||
| 45 | uint32_t raw; | ||
| 46 | struct { | ||
| 47 | uint8_t rgb_mode :8; | ||
| 48 | }; | ||
| 49 | } user_config_t; | ||
| 50 | |||
| 51 | user_config_t user_config; | ||
| 52 | |||
| 53 | // enum layer_keycodes { }; | 32 | // enum layer_keycodes { }; |
| 54 | 33 | ||
| 55 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 34 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| @@ -121,94 +100,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 121 | ), | 100 | ), |
| 122 | }; | 101 | }; |
| 123 | 102 | ||
| 124 | void keyboard_post_init_user(void) { | ||
| 125 | user_config.raw = eeconfig_read_user(); | ||
| 126 | switch (user_config.rgb_mode) { | ||
| 127 | case RGB_MODE_ALL: | ||
| 128 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 129 | rgb_matrix_enable_noeeprom(); | ||
| 130 | break; | ||
| 131 | case RGB_MODE_KEYLIGHT: | ||
| 132 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 133 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 134 | break; | ||
| 135 | case RGB_MODE_UNDERGLOW: | ||
| 136 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 137 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 138 | break; | ||
| 139 | case RGB_MODE_NONE: | ||
| 140 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 141 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 142 | break; | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 147 | switch (keycode) { | ||
| 148 | case RGB_TOG: | ||
| 149 | if (record->event.pressed) { | ||
| 150 | switch (rgb_matrix_get_flags()) { | ||
| 151 | case LED_FLAG_ALL: { | ||
| 152 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 153 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 154 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 155 | } | ||
| 156 | break; | ||
| 157 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 158 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 159 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 160 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 161 | } | ||
| 162 | break; | ||
| 163 | case (LED_FLAG_UNDERGLOW): { | ||
| 164 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 165 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 166 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 167 | } | ||
| 168 | break; | ||
| 169 | default: { | ||
| 170 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 171 | rgb_matrix_enable_noeeprom(); | ||
| 172 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 173 | } | ||
| 174 | break; | ||
| 175 | } | ||
| 176 | eeconfig_update_user(user_config.raw); | ||
| 177 | } | ||
| 178 | return false; | ||
| 179 | } | ||
| 180 | |||
| 181 | return true; | ||
| 182 | } | ||
| 183 | |||
| 184 | bool rgb_matrix_indicators_user(void) { | ||
| 185 | HSV hsv = rgb_matrix_config.hsv; | ||
| 186 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 187 | hsv.h = time; | ||
| 188 | RGB rgb = hsv_to_rgb(hsv); | ||
| 189 | |||
| 190 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 191 | if (host_keyboard_led_state().caps_lock) { | ||
| 192 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 193 | } | ||
| 194 | if (host_keyboard_led_state().scroll_lock) { | ||
| 195 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 196 | } | ||
| 197 | } else { | ||
| 198 | if (host_keyboard_led_state().caps_lock) { | ||
| 199 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 200 | } else { | ||
| 201 | rgb_matrix_set_color(25, 0, 0, 0); | ||
| 202 | } | ||
| 203 | if (host_keyboard_led_state().scroll_lock) { | ||
| 204 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 205 | } else { | ||
| 206 | rgb_matrix_set_color(73, 0, 0, 0); | ||
| 207 | } | ||
| 208 | } | ||
| 209 | return false; | ||
| 210 | } | ||
| 211 | |||
| 212 | #ifdef OLED_ENABLE | 103 | #ifdef OLED_ENABLE |
| 213 | bool oled_task_user(void) { | 104 | bool oled_task_user(void) { |
| 214 | led_t led_usb_state = host_keyboard_led_state(); | 105 | led_t led_usb_state = host_keyboard_led_state(); |
diff --git a/keyboards/gopolar/gg86/keymaps/bongocat/readme.md b/keyboards/gopolar/gg86/keymaps/bongocat/readme.md index 632f9c67e2..9e02220c4c 100644 --- a/keyboards/gopolar/gg86/keymaps/bongocat/readme.md +++ b/keyboards/gopolar/gg86/keymaps/bongocat/readme.md | |||
| @@ -1,3 +1 @@ | |||
| 1 | # Keymap with VIA and Bongo Cat on OLED | # Keymap with VIA and Bongo Cat on OLED | |
| 2 | |||
| 3 | Keymap is default 87 qwerty, with TKL 7u-spacebar layout | ||
diff --git a/keyboards/gopolar/gg86/keymaps/default/keymap.c b/keyboards/gopolar/gg86/keymaps/default/keymap.c index 1d043a95d8..e192d46a80 100644 --- a/keyboards/gopolar/gg86/keymaps/default/keymap.c +++ b/keyboards/gopolar/gg86/keymaps/default/keymap.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 Gopolar | 1 | /* Copyright 2023 Gopolar |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -19,11 +19,6 @@ | |||
| 19 | // OLED animation | 19 | // OLED animation |
| 20 | #include "lib/wave.h" | 20 | #include "lib/wave.h" |
| 21 | 21 | ||
| 22 | #include <string.h> | ||
| 23 | #include <math.h> | ||
| 24 | |||
| 25 | #include <lib/lib8tion/lib8tion.h> | ||
| 26 | |||
| 27 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 22 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
| 28 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 23 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
| 29 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | 24 | // Layer names don't all need to be of the same length, obviously, and you can also skip them |
| @@ -31,22 +26,6 @@ | |||
| 31 | 26 | ||
| 32 | // enum layer_names { }; | 27 | // enum layer_names { }; |
| 33 | 28 | ||
| 34 | enum user_rgb_mode { | ||
| 35 | RGB_MODE_ALL, | ||
| 36 | RGB_MODE_KEYLIGHT, | ||
| 37 | RGB_MODE_UNDERGLOW, | ||
| 38 | RGB_MODE_NONE, | ||
| 39 | }; | ||
| 40 | |||
| 41 | typedef union { | ||
| 42 | uint32_t raw; | ||
| 43 | struct { | ||
| 44 | uint8_t rgb_mode :8; | ||
| 45 | }; | ||
| 46 | } user_config_t; | ||
| 47 | |||
| 48 | user_config_t user_config; | ||
| 49 | |||
| 50 | // enum layer_keycodes { }; | 29 | // enum layer_keycodes { }; |
| 51 | 30 | ||
| 52 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| @@ -170,94 +149,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 170 | ), | 149 | ), |
| 171 | }; | 150 | }; |
| 172 | 151 | ||
| 173 | void keyboard_post_init_user(void) { | ||
| 174 | user_config.raw = eeconfig_read_user(); | ||
| 175 | switch (user_config.rgb_mode) { | ||
| 176 | case RGB_MODE_ALL: | ||
| 177 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 178 | rgb_matrix_enable_noeeprom(); | ||
| 179 | break; | ||
| 180 | case RGB_MODE_KEYLIGHT: | ||
| 181 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 182 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 183 | break; | ||
| 184 | case RGB_MODE_UNDERGLOW: | ||
| 185 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 186 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 187 | break; | ||
| 188 | case RGB_MODE_NONE: | ||
| 189 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 190 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 191 | break; | ||
| 192 | } | ||
| 193 | } | ||
| 194 | |||
| 195 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 196 | switch (keycode) { | ||
| 197 | case RGB_TOG: | ||
| 198 | if (record->event.pressed) { | ||
| 199 | switch (rgb_matrix_get_flags()) { | ||
| 200 | case LED_FLAG_ALL: { | ||
| 201 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 202 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 203 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 204 | } | ||
| 205 | break; | ||
| 206 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 207 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 208 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 209 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 210 | } | ||
| 211 | break; | ||
| 212 | case (LED_FLAG_UNDERGLOW): { | ||
| 213 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 214 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 215 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 216 | } | ||
| 217 | break; | ||
| 218 | default: { | ||
| 219 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 220 | rgb_matrix_enable_noeeprom(); | ||
| 221 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 222 | } | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | eeconfig_update_user(user_config.raw); | ||
| 226 | } | ||
| 227 | return false; | ||
| 228 | } | ||
| 229 | |||
| 230 | return true; | ||
| 231 | } | ||
| 232 | |||
| 233 | bool rgb_matrix_indicators_user(void) { | ||
| 234 | HSV hsv = rgb_matrix_config.hsv; | ||
| 235 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 236 | hsv.h = time; | ||
| 237 | RGB rgb = hsv_to_rgb(hsv); | ||
| 238 | |||
| 239 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 240 | if (host_keyboard_led_state().caps_lock) { | ||
| 241 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 242 | } | ||
| 243 | if (host_keyboard_led_state().scroll_lock) { | ||
| 244 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 245 | } | ||
| 246 | } else { | ||
| 247 | if (host_keyboard_led_state().caps_lock) { | ||
| 248 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 249 | } else { | ||
| 250 | rgb_matrix_set_color(25, 0, 0, 0); | ||
| 251 | } | ||
| 252 | if (host_keyboard_led_state().scroll_lock) { | ||
| 253 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 254 | } else { | ||
| 255 | rgb_matrix_set_color(73, 0, 0, 0); | ||
| 256 | } | ||
| 257 | } | ||
| 258 | return false; | ||
| 259 | } | ||
| 260 | |||
| 261 | #ifdef OLED_ENABLE | 152 | #ifdef OLED_ENABLE |
| 262 | static void render_layer_info(void) { | 153 | static void render_layer_info(void) { |
| 263 | switch (get_highest_layer(layer_state)) { | 154 | switch (get_highest_layer(layer_state)) { |
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/config.h b/keyboards/gopolar/gg86/keymaps/horrortroll/config.h deleted file mode 100644 index 246f36bb94..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/config.h +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define DYNAMIC_KEYMAP_LAYER_COUNT 2 | ||
| 20 | #define NO_ACTION_ONESHOT | ||
| 21 | |||
| 22 | #ifdef RGB_MATRIX_ENABLE | ||
| 23 | /* RGB Matrix effect */ | ||
| 24 | #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 25 | #undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
| 26 | #undef ENABLE_RGB_MATRIX_BAND_SAT | ||
| 27 | #undef ENABLE_RGB_MATRIX_BAND_VAL | ||
| 28 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 29 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
| 30 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 31 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
| 32 | #undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 33 | #undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 34 | #undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 35 | #undef ENABLE_RGB_MATRIX_DUAL_BEACON | ||
| 36 | #undef ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 37 | #undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 38 | #undef ENABLE_RGB_MATRIX_RAINDROPS | ||
| 39 | #undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 40 | #undef ENABLE_RGB_MATRIX_HUE_WAVE | ||
| 41 | #undef ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
| 42 | |||
| 43 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 44 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 45 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 46 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 47 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 48 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 49 | #undef ENABLE_RGB_MATRIX_SPLASH | ||
| 50 | #undef ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 51 | #undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 52 | #endif | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/keymap.c b/keyboards/gopolar/gg86/keymaps/horrortroll/keymap.c index 65d473639d..fc725ad3f0 100644 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/keymap.c +++ b/keyboards/gopolar/gg86/keymaps/horrortroll/keymap.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -16,7 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | 18 | ||
| 19 | #include "keymap_stuff.h" | 19 | #include "horrortroll.h" |
| 20 | #include "oled/oled_stuff.h" | ||
| 20 | 21 | ||
| 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 22 | 23 | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/keymap_stuff.h b/keyboards/gopolar/gg86/keymaps/horrortroll/keymap_stuff.h deleted file mode 100644 index 9003cd5e6b..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/keymap_stuff.h +++ /dev/null | |||
| @@ -1,305 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "oled/oled_stuff.h" | ||
| 18 | #include <string.h> | ||
| 19 | #include <math.h> | ||
| 20 | |||
| 21 | #include <lib/lib8tion/lib8tion.h> | ||
| 22 | |||
| 23 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 24 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 25 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 26 | // entirely and just use numbers. | ||
| 27 | |||
| 28 | enum layer_names { | ||
| 29 | _BASE, | ||
| 30 | _FN, | ||
| 31 | }; | ||
| 32 | |||
| 33 | // For CUSTOM_GRADIENT | ||
| 34 | HSV gradient_0 = {205, 250, 255}; | ||
| 35 | HSV gradient_100 = {140, 215, 125}; | ||
| 36 | bool reflected_gradient = false; | ||
| 37 | uint8_t gp_i = 0; | ||
| 38 | |||
| 39 | typedef struct { | ||
| 40 | HSV gradient_0; | ||
| 41 | HSV gradient_1; | ||
| 42 | bool reflected; | ||
| 43 | } CUSTOM_PRESETS; | ||
| 44 | |||
| 45 | enum user_rgb_mode { | ||
| 46 | RGB_MODE_ALL, | ||
| 47 | RGB_MODE_KEYLIGHT, | ||
| 48 | RGB_MODE_UNDERGLOW, | ||
| 49 | RGB_MODE_NONE, | ||
| 50 | }; | ||
| 51 | |||
| 52 | typedef union { | ||
| 53 | uint32_t raw; | ||
| 54 | struct { | ||
| 55 | uint8_t rgb_mode :8; | ||
| 56 | }; | ||
| 57 | } user_config_t; | ||
| 58 | |||
| 59 | user_config_t user_config; | ||
| 60 | |||
| 61 | enum layer_keycodes { | ||
| 62 | //Custom Gradient control keycode | ||
| 63 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
| 64 | G1_HUD, //Custom gradient color 1 hue decrease | ||
| 65 | G1_SAI, //Custom gradient color 1 saturation increase | ||
| 66 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
| 67 | G1_VAI, //Custom gradient color 1 value increase | ||
| 68 | G1_VAD, //Custom gradient color 1 value decrease | ||
| 69 | G2_HUI, //Custom gradient color 2 hue increase | ||
| 70 | G2_HUD, //Custom gradient color 2 hue decrease | ||
| 71 | G2_SAI, //Custom gradient color 2 saturation increase | ||
| 72 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
| 73 | G2_VAI, //Custom gradient color 2 value increase | ||
| 74 | G2_VAD, //Custom gradient color 2 value decrease | ||
| 75 | G_PRE, //Gradient presets | ||
| 76 | REF_G, //Toggle between linear and reflected gradient | ||
| 77 | G_FLIP, //Flip the gradient colors | ||
| 78 | |||
| 79 | //Custom led effect keycode | ||
| 80 | RGB_C_E, //Cycle user effect | ||
| 81 | }; | ||
| 82 | |||
| 83 | void keyboard_post_init_user(void) { | ||
| 84 | user_config.raw = eeconfig_read_user(); | ||
| 85 | switch (user_config.rgb_mode) { | ||
| 86 | case RGB_MODE_ALL: | ||
| 87 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 88 | rgb_matrix_enable_noeeprom(); | ||
| 89 | break; | ||
| 90 | case RGB_MODE_KEYLIGHT: | ||
| 91 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 92 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 93 | break; | ||
| 94 | case RGB_MODE_UNDERGLOW: | ||
| 95 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 96 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 97 | break; | ||
| 98 | case RGB_MODE_NONE: | ||
| 99 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 100 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 101 | break; | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 106 | process_record_user_oled(keycode, record); | ||
| 107 | |||
| 108 | uint8_t color_adj_step = 5; | ||
| 109 | |||
| 110 | CUSTOM_PRESETS gradient_presets[] = { | ||
| 111 | {{41 , 255, 255}, {233, 245, 255}, false }, | ||
| 112 | {{45 , 245, 155}, {160, 255, 80}, false }, | ||
| 113 | {{173, 245, 40}, {41 , 255, 205}, true }, | ||
| 114 | {{32 , 255, 165}, {217, 185, 70}, false }, | ||
| 115 | {{240, 255, 145}, {115, 255, 245}, true }, | ||
| 116 | {{118, 255, 255}, {242, 255, 255}, false }, | ||
| 117 | {{212, 0 , 0}, {223, 235, 165}, true }, | ||
| 118 | {{205, 250, 255}, {140, 215, 125}, false }, | ||
| 119 | }; | ||
| 120 | |||
| 121 | uint8_t gp_length = ARRAY_SIZE(gradient_presets); | ||
| 122 | |||
| 123 | switch (keycode) { | ||
| 124 | case G1_HUI: | ||
| 125 | if (record->event.pressed) { | ||
| 126 | gradient_0.h += color_adj_step; | ||
| 127 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 128 | } | ||
| 129 | return false; | ||
| 130 | case G1_HUD: | ||
| 131 | if (record->event.pressed) { | ||
| 132 | gradient_0.h -= color_adj_step; | ||
| 133 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 134 | } | ||
| 135 | return false; | ||
| 136 | case G1_SAI: | ||
| 137 | if (record->event.pressed) { | ||
| 138 | gradient_0.s = (gradient_0.s + color_adj_step * 2 <= 255) ? gradient_0.s + color_adj_step * 2 : 255; | ||
| 139 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 140 | } | ||
| 141 | return false; | ||
| 142 | case G1_SAD: | ||
| 143 | if (record->event.pressed) { | ||
| 144 | gradient_0.s = (gradient_0.s - color_adj_step * 2 >= 0) ? gradient_0.s - color_adj_step * 2 : 0; | ||
| 145 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 146 | } | ||
| 147 | return false; | ||
| 148 | case G1_VAI: | ||
| 149 | if (record->event.pressed) { | ||
| 150 | gradient_0.v = (gradient_0.v + color_adj_step * 2 <= 255) ? gradient_0.v + color_adj_step * 2 : 255; | ||
| 151 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 152 | } | ||
| 153 | return false; | ||
| 154 | case G1_VAD: | ||
| 155 | if (record->event.pressed) { | ||
| 156 | gradient_0.v = (gradient_0.v - color_adj_step * 2 >= 0) ? gradient_0.v - color_adj_step * 2 : 0; | ||
| 157 | dprintf("Gradient 0 HSV: %d, %d, %d\n", gradient_0.h, gradient_0.s, gradient_0.v); | ||
| 158 | } | ||
| 159 | return false; | ||
| 160 | case G2_HUI: | ||
| 161 | if (record->event.pressed) { | ||
| 162 | gradient_100.h += color_adj_step; | ||
| 163 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 164 | } | ||
| 165 | return false; | ||
| 166 | case G2_HUD: | ||
| 167 | if (record->event.pressed) { | ||
| 168 | gradient_100.h -= color_adj_step; | ||
| 169 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 170 | } | ||
| 171 | return false; | ||
| 172 | case G2_SAI: | ||
| 173 | if (record->event.pressed) { | ||
| 174 | gradient_100.s = (gradient_100.s + color_adj_step * 2 <= 255) ? gradient_100.s + color_adj_step * 2 : 255; | ||
| 175 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 176 | } | ||
| 177 | return false; | ||
| 178 | case G2_SAD: | ||
| 179 | if (record->event.pressed) { | ||
| 180 | gradient_100.s = (gradient_100.s - color_adj_step * 2 >= 0) ? gradient_100.s - color_adj_step * 2 : 0; | ||
| 181 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 182 | } | ||
| 183 | return false; | ||
| 184 | case G2_VAI: | ||
| 185 | if (record->event.pressed) { | ||
| 186 | gradient_100.v = (gradient_100.v + color_adj_step * 2 <= 255) ? gradient_100.v + color_adj_step * 2 : 255; | ||
| 187 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 188 | } | ||
| 189 | return false; | ||
| 190 | case G2_VAD: | ||
| 191 | if (record->event.pressed) { | ||
| 192 | gradient_100.v = (gradient_100.v - color_adj_step * 2 >= 0) ? gradient_100.v - color_adj_step * 2 : 0; | ||
| 193 | dprintf("Gradient 100 HSV: %d, %d, %d\n", gradient_100.h, gradient_100.s, gradient_100.v); | ||
| 194 | } | ||
| 195 | return false; | ||
| 196 | case G_PRE: | ||
| 197 | if (record->event.pressed) { | ||
| 198 | gp_i = (gp_i + gp_length ) % gp_length; | ||
| 199 | |||
| 200 | gradient_0 = gradient_presets[gp_i].gradient_0; | ||
| 201 | gradient_100 = gradient_presets[gp_i].gradient_1; | ||
| 202 | reflected_gradient = gradient_presets[gp_i].reflected; | ||
| 203 | |||
| 204 | gp_i += 1; | ||
| 205 | } | ||
| 206 | return false; | ||
| 207 | case REF_G: | ||
| 208 | if (record->event.pressed) { | ||
| 209 | reflected_gradient = !reflected_gradient; | ||
| 210 | } | ||
| 211 | return false; | ||
| 212 | case G_FLIP: | ||
| 213 | if (record->event.pressed) { | ||
| 214 | HSV temp_color = gradient_0; | ||
| 215 | gradient_0 = gradient_100; | ||
| 216 | gradient_100 = temp_color; | ||
| 217 | } | ||
| 218 | return false; | ||
| 219 | case RGB_C_E: | ||
| 220 | if (record->event.pressed) { | ||
| 221 | switch (rgb_matrix_get_mode()) { | ||
| 222 | case RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT: | ||
| 223 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_COOL_DIAGONAL); | ||
| 224 | return false; | ||
| 225 | case RGB_MATRIX_CUSTOM_COOL_DIAGONAL: | ||
| 226 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_FLOWER_BLOOMING); | ||
| 227 | return false; | ||
| 228 | case RGB_MATRIX_CUSTOM_FLOWER_BLOOMING: | ||
| 229 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RAINBOW_REACTIVE_SIMPLE); | ||
| 230 | return false; | ||
| 231 | case RGB_MATRIX_CUSTOM_RAINBOW_REACTIVE_SIMPLE: | ||
| 232 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_KITT); | ||
| 233 | return false; | ||
| 234 | case RGB_MATRIX_CUSTOM_KITT: | ||
| 235 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); | ||
| 236 | return false; | ||
| 237 | default: | ||
| 238 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_CUSTOM_GRADIENT); | ||
| 239 | return false; | ||
| 240 | } | ||
| 241 | } | ||
| 242 | return false; | ||
| 243 | case RGB_TOG: | ||
| 244 | if (record->event.pressed) { | ||
| 245 | switch (rgb_matrix_get_flags()) { | ||
| 246 | case LED_FLAG_ALL: { | ||
| 247 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 248 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 249 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 250 | } | ||
| 251 | break; | ||
| 252 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 253 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 254 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 255 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 256 | } | ||
| 257 | break; | ||
| 258 | case (LED_FLAG_UNDERGLOW): { | ||
| 259 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 260 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 261 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 262 | } | ||
| 263 | break; | ||
| 264 | default: { | ||
| 265 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 266 | rgb_matrix_enable_noeeprom(); | ||
| 267 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 268 | } | ||
| 269 | break; | ||
| 270 | } | ||
| 271 | eeconfig_update_user(user_config.raw); | ||
| 272 | } | ||
| 273 | return false; | ||
| 274 | } | ||
| 275 | |||
| 276 | return true; | ||
| 277 | } | ||
| 278 | |||
| 279 | bool rgb_matrix_indicators_user(void) { | ||
| 280 | HSV hsv = rgb_matrix_config.hsv; | ||
| 281 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 282 | hsv.h = time; | ||
| 283 | RGB rgb = hsv_to_rgb(hsv); | ||
| 284 | |||
| 285 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 286 | if (host_keyboard_led_state().caps_lock) { | ||
| 287 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 288 | } | ||
| 289 | if (host_keyboard_led_state().scroll_lock) { | ||
| 290 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 291 | } | ||
| 292 | } else { | ||
| 293 | if (host_keyboard_led_state().caps_lock) { | ||
| 294 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 295 | } else { | ||
| 296 | rgb_matrix_set_color(25, 0, 0, 0); | ||
| 297 | } | ||
| 298 | if (host_keyboard_led_state().scroll_lock) { | ||
| 299 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 300 | } else { | ||
| 301 | rgb_matrix_set_color(73, 0, 0, 0); | ||
| 302 | } | ||
| 303 | } | ||
| 304 | return false; | ||
| 305 | } | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/cool_diagonal.c b/keyboards/gopolar/gg86/keymaps/horrortroll/led/cool_diagonal.c deleted file mode 100644 index 2c518a5431..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/cool_diagonal.c +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | static HSV COOL_DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) { | ||
| 18 | hsv.h = (g_led_config.point[i].x / 4) - g_led_config.point[i].y - time; | ||
| 19 | return hsv; | ||
| 20 | } | ||
| 21 | |||
| 22 | bool COOL_DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &COOL_DIAGONAL_math); } \ No newline at end of file | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/custom_gradient.c b/keyboards/gopolar/gg86/keymaps/horrortroll/led/custom_gradient.c deleted file mode 100644 index 951884b456..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/custom_gradient.c +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | extern HSV gradient_0; | ||
| 18 | extern HSV gradient_100; | ||
| 19 | extern bool reflected_gradient; | ||
| 20 | |||
| 21 | static HSV INTERPOLATE_HSV(float step, HSV gradient_0, HSV gradient_100) { | ||
| 22 | uint8_t cw, ccw; | ||
| 23 | HSV color; | ||
| 24 | |||
| 25 | cw = (gradient_0.h >= gradient_100.h) ? 255 + gradient_100.h - gradient_0.h : gradient_100.h - gradient_0.h; // Hue range is 0 to 255. | ||
| 26 | ccw = (gradient_0.h >= gradient_100.h) ? gradient_0.h - gradient_100.h : 255 + gradient_0.h - gradient_100.h; | ||
| 27 | |||
| 28 | if( cw < ccw ) { // going clockwise | ||
| 29 | color.h = gradient_0.h + (uint8_t)(step * cw); | ||
| 30 | } else { // Going counter clockwise | ||
| 31 | color.h = gradient_0.h - (uint8_t)(step * ccw); | ||
| 32 | } | ||
| 33 | |||
| 34 | color.s = gradient_0.s + step * (gradient_100.s - gradient_0.s); | ||
| 35 | |||
| 36 | // Scale V with global RGB Matrix's V, so users can still control overall brightness with RGB_VAI & RGB_VAD0 | ||
| 37 | color.v = round((gradient_0.v + step * (gradient_100.v - gradient_0.v)) * ((float)rgb_matrix_config.hsv.v / 255)); | ||
| 38 | |||
| 39 | return color; | ||
| 40 | } | ||
| 41 | |||
| 42 | static HSV CUSTOM_GRADIENT_math(uint8_t led_x, uint8_t min_x, uint8_t max_x) { | ||
| 43 | float step = (float)led_x / (max_x - min_x); | ||
| 44 | float mid_gradient_pos = 0.5; | ||
| 45 | |||
| 46 | if( reflected_gradient ) { | ||
| 47 | if( step <= mid_gradient_pos ) { | ||
| 48 | return INTERPOLATE_HSV(step * (1/mid_gradient_pos), gradient_0, gradient_100); | ||
| 49 | } else { | ||
| 50 | return INTERPOLATE_HSV((step - mid_gradient_pos) * (1/(1-mid_gradient_pos)), gradient_100, gradient_0); | ||
| 51 | } | ||
| 52 | |||
| 53 | } else { | ||
| 54 | return INTERPOLATE_HSV(step, gradient_0, gradient_100); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | static bool CUSTOM_GRADIENT(effect_params_t* params) { | ||
| 59 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 60 | |||
| 61 | uint8_t min_x = 0; // X coordinate of the left-most LED | ||
| 62 | uint8_t max_x = 224; // X coordinate of the right-most LED | ||
| 63 | |||
| 64 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 65 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
| 66 | |||
| 67 | HSV hsv_orig = CUSTOM_GRADIENT_math(g_led_config.point[i].x, min_x, max_x); | ||
| 68 | RGB rgb = hsv_to_rgb(hsv_orig); | ||
| 69 | |||
| 70 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 71 | } | ||
| 72 | |||
| 73 | return led_max < RGB_MATRIX_LED_COUNT; | ||
| 74 | } \ No newline at end of file | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/flower_blooming/flower_blooming.h b/keyboards/gopolar/gg86/keymaps/horrortroll/led/flower_blooming/flower_blooming.h deleted file mode 100644 index 941dab975a..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/flower_blooming/flower_blooming.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | typedef HSV (*flower_blooming_f)(HSV hsv, uint8_t i, uint8_t time); | ||
| 4 | |||
| 5 | bool effect_runner_bloom(effect_params_t* params, flower_blooming_f effect_func) { | ||
| 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 7 | |||
| 8 | uint8_t time = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed / 10, 1)); | ||
| 9 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 10 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
| 11 | if (g_led_config.point[i].y > k_rgb_matrix_center.y) { | ||
| 12 | RGB bgr = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); | ||
| 13 | rgb_matrix_set_color(i, bgr.b, bgr.g, bgr.r); | ||
| 14 | } else { | ||
| 15 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); | ||
| 16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 17 | } | ||
| 18 | } | ||
| 19 | return rgb_matrix_check_finished_leds(led_max); | ||
| 20 | } | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/kitt.c b/keyboards/gopolar/gg86/keymaps/horrortroll/led/kitt.c deleted file mode 100644 index bfc32ce040..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/kitt.c +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | // variable for startup animation | ||
| 18 | bool BASE_EFFECT_NOT_STARTED_YET = true; | ||
| 19 | uint8_t base_effect_startup_counter = 255; | ||
| 20 | |||
| 21 | uint8_t led_count = 11; | ||
| 22 | uint8_t led_first = 41; | ||
| 23 | |||
| 24 | static uint8_t time_to_led(uint8_t time, uint8_t led_behind) { | ||
| 25 | uint16_t led_time = led_count * time; | ||
| 26 | uint16_t step = ((2 * led_count + (led_time / 128)) - led_behind) % (2 * led_count); | ||
| 27 | uint8_t led; | ||
| 28 | |||
| 29 | if (step < led_count) { | ||
| 30 | led = step; | ||
| 31 | } else { | ||
| 32 | led = led_count - 1 - (step - led_count); | ||
| 33 | } | ||
| 34 | |||
| 35 | return led; | ||
| 36 | } | ||
| 37 | |||
| 38 | static HSV KITT_math(HSV hsv, uint8_t i, uint8_t time) { | ||
| 39 | |||
| 40 | // reset base effect startup | ||
| 41 | if (i == 0) { | ||
| 42 | BASE_EFFECT_NOT_STARTED_YET = true; | ||
| 43 | } | ||
| 44 | |||
| 45 | hsv.h = 0; | ||
| 46 | hsv.s = 255; | ||
| 47 | |||
| 48 | if (i >= led_first && i < led_first + led_count) { | ||
| 49 | uint8_t j = i - led_first; | ||
| 50 | if (j == time_to_led(time, 0)) { | ||
| 51 | hsv.v = hsv.v; | ||
| 52 | } else if (j == time_to_led(time, 1)) { | ||
| 53 | hsv.v = hsv.v/2; | ||
| 54 | } else if (j == time_to_led(time, 2)) { | ||
| 55 | hsv.v = hsv.v/4; | ||
| 56 | } else if (j == time_to_led(time, 3)) { | ||
| 57 | hsv.v = hsv.v/8; | ||
| 58 | } else { | ||
| 59 | hsv.v = 0; | ||
| 60 | } | ||
| 61 | } else { | ||
| 62 | hsv.v = 0; | ||
| 63 | } | ||
| 64 | |||
| 65 | return hsv; | ||
| 66 | } | ||
| 67 | |||
| 68 | bool KITT(effect_params_t* params) { return effect_runner_i(params, &KITT_math); } \ No newline at end of file | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h b/keyboards/gopolar/gg86/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h deleted file mode 100644 index 9fff344664..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.h +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | typedef HSV (*rainbow_reactive_f)(HSV hsv, uint8_t i, uint8_t time, uint16_t offset); | ||
| 20 | |||
| 21 | bool effect_rainbow_reactive(effect_params_t* params, rainbow_reactive_f effect_func) { | ||
| 22 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 23 | |||
| 24 | uint8_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 4); | ||
| 25 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; | ||
| 26 | |||
| 27 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 28 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
| 29 | uint16_t tick = max_tick; | ||
| 30 | |||
| 31 | // Reverse search to find most recent key hit | ||
| 32 | for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { | ||
| 33 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { | ||
| 34 | tick = g_last_hit_tracker.tick[j]; | ||
| 35 | break; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); | ||
| 40 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time, offset)); | ||
| 41 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 42 | } | ||
| 43 | |||
| 44 | return led_max < RGB_MATRIX_LED_COUNT; | ||
| 45 | } \ No newline at end of file | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/random_breath_rainbow.c b/keyboards/gopolar/gg86/keymaps/horrortroll/led/random_breath_rainbow.c deleted file mode 100644 index b5ffef665f..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/random_breath_rainbow.c +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | static uint8_t offset[RGB_MATRIX_LED_COUNT]; | ||
| 18 | |||
| 19 | static void doRandom_breath_rainbow(int i, effect_params_t* params) { | ||
| 20 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | ||
| 21 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 6); | ||
| 22 | |||
| 23 | if (rand() * 50 == 1) { | ||
| 24 | if (rand() * 2 == 1) { | ||
| 25 | offset[i]++; | ||
| 26 | } | ||
| 27 | else { | ||
| 28 | offset[i]--; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | //float val = (((float)sin8(time + offset[i]) / 256)/2.1) + .05; | ||
| 33 | HSV hsv = {0, 255, 255}; | ||
| 34 | hsv.h = scale16by8(g_rgb_timer + offset[i], rgb_matrix_config.speed / 4) + (offset[i]*2); | ||
| 35 | hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); | ||
| 36 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); | ||
| 37 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 38 | } | ||
| 39 | |||
| 40 | bool RANDOM_BREATH_RAINBOW(effect_params_t* params) { | ||
| 41 | |||
| 42 | if (!params->init) { | ||
| 43 | // Change one LED every tick, make sure speed is not 0 | ||
| 44 | doRandom_breath_rainbow(rand() % RGB_MATRIX_LED_COUNT, params); | ||
| 45 | return false; | ||
| 46 | } | ||
| 47 | |||
| 48 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 49 | |||
| 50 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 51 | doRandom_breath_rainbow(i, params); | ||
| 52 | } | ||
| 53 | |||
| 54 | return led_max < RGB_MATRIX_LED_COUNT; | ||
| 55 | } \ No newline at end of file | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/readme.md b/keyboards/gopolar/gg86/keymaps/horrortroll/readme.md deleted file mode 100644 index 363330e98f..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/readme.md +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | # My personal keymap with VIA and custom LED / OLED | ||
| 2 | |||
| 3 | Keymap is default 87 qwerty, with TKL 7u-spacebar layout | ||
| 4 | |||
| 5 | It have new LED effect: | ||
| 6 | |||
| 7 | - Custom gradient (ported from SirTimmyTimbit code [https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt]) | ||
| 8 | - Cool diagonal (ported from pleasuretek code [https://github.com/pleasuretek/qmk_firmware]) | ||
| 9 | - Flower Blooming | ||
| 10 | - Rainbow reactive simple | ||
| 11 | - Knight Rider (ported from jumper149 code [https://github.com/jumper149/qmk_firmware/blob/jumper149/keyboards/dztech/dz65rgb/keymaps/jumper149/]) | ||
| 12 | - Random breath rainbow (based from daed code [https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed] and modify by me) | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/rgb_matrix_user.inc b/keyboards/gopolar/gg86/keymaps/horrortroll/rgb_matrix_user.inc deleted file mode 100644 index 7a31991027..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/rgb_matrix_user.inc +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) | ||
| 2 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) | ||
| 3 | RGB_MATRIX_EFFECT(FLOWER_BLOOMING) | ||
| 4 | RGB_MATRIX_EFFECT(RAINBOW_REACTIVE_SIMPLE) | ||
| 5 | RGB_MATRIX_EFFECT(KITT) | ||
| 6 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | ||
| 7 | |||
| 8 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 9 | |||
| 10 | #include "led/custom_gradient.c" | ||
| 11 | #include "led/cool_diagonal.c" | ||
| 12 | #include "led/flower_blooming/flower_blooming.c" | ||
| 13 | #include "led/rainbow_reactive_simple/rainbow_reactive_simple.c" | ||
| 14 | #include "led/kitt.c" | ||
| 15 | #include "led/random_breath_rainbow.c" | ||
| 16 | |||
| 17 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/rules.mk b/keyboards/gopolar/gg86/keymaps/horrortroll/rules.mk deleted file mode 100644 index d475530c87..0000000000 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/rules.mk +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | |||
| 3 | RGB_MATRIX_CUSTOM_USER = yes | ||
diff --git a/keyboards/gopolar/gg86/keymaps/via/keymap.c b/keyboards/gopolar/gg86/keymaps/via/keymap.c index 1d043a95d8..e192d46a80 100644 --- a/keyboards/gopolar/gg86/keymaps/via/keymap.c +++ b/keyboards/gopolar/gg86/keymaps/via/keymap.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 Gopolar | 1 | /* Copyright 2023 Gopolar |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -19,11 +19,6 @@ | |||
| 19 | // OLED animation | 19 | // OLED animation |
| 20 | #include "lib/wave.h" | 20 | #include "lib/wave.h" |
| 21 | 21 | ||
| 22 | #include <string.h> | ||
| 23 | #include <math.h> | ||
| 24 | |||
| 25 | #include <lib/lib8tion/lib8tion.h> | ||
| 26 | |||
| 27 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 22 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
| 28 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 23 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
| 29 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | 24 | // Layer names don't all need to be of the same length, obviously, and you can also skip them |
| @@ -31,22 +26,6 @@ | |||
| 31 | 26 | ||
| 32 | // enum layer_names { }; | 27 | // enum layer_names { }; |
| 33 | 28 | ||
| 34 | enum user_rgb_mode { | ||
| 35 | RGB_MODE_ALL, | ||
| 36 | RGB_MODE_KEYLIGHT, | ||
| 37 | RGB_MODE_UNDERGLOW, | ||
| 38 | RGB_MODE_NONE, | ||
| 39 | }; | ||
| 40 | |||
| 41 | typedef union { | ||
| 42 | uint32_t raw; | ||
| 43 | struct { | ||
| 44 | uint8_t rgb_mode :8; | ||
| 45 | }; | ||
| 46 | } user_config_t; | ||
| 47 | |||
| 48 | user_config_t user_config; | ||
| 49 | |||
| 50 | // enum layer_keycodes { }; | 29 | // enum layer_keycodes { }; |
| 51 | 30 | ||
| 52 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| @@ -170,94 +149,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 170 | ), | 149 | ), |
| 171 | }; | 150 | }; |
| 172 | 151 | ||
| 173 | void keyboard_post_init_user(void) { | ||
| 174 | user_config.raw = eeconfig_read_user(); | ||
| 175 | switch (user_config.rgb_mode) { | ||
| 176 | case RGB_MODE_ALL: | ||
| 177 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 178 | rgb_matrix_enable_noeeprom(); | ||
| 179 | break; | ||
| 180 | case RGB_MODE_KEYLIGHT: | ||
| 181 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 182 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 183 | break; | ||
| 184 | case RGB_MODE_UNDERGLOW: | ||
| 185 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 186 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 187 | break; | ||
| 188 | case RGB_MODE_NONE: | ||
| 189 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 190 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 191 | break; | ||
| 192 | } | ||
| 193 | } | ||
| 194 | |||
| 195 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 196 | switch (keycode) { | ||
| 197 | case RGB_TOG: | ||
| 198 | if (record->event.pressed) { | ||
| 199 | switch (rgb_matrix_get_flags()) { | ||
| 200 | case LED_FLAG_ALL: { | ||
| 201 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); | ||
| 202 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 203 | user_config.rgb_mode = RGB_MODE_KEYLIGHT; | ||
| 204 | } | ||
| 205 | break; | ||
| 206 | case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { | ||
| 207 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 208 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 209 | user_config.rgb_mode = RGB_MODE_UNDERGLOW; | ||
| 210 | } | ||
| 211 | break; | ||
| 212 | case (LED_FLAG_UNDERGLOW): { | ||
| 213 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 214 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 215 | user_config.rgb_mode = RGB_MODE_NONE; | ||
| 216 | } | ||
| 217 | break; | ||
| 218 | default: { | ||
| 219 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 220 | rgb_matrix_enable_noeeprom(); | ||
| 221 | user_config.rgb_mode = RGB_MODE_ALL; | ||
| 222 | } | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | eeconfig_update_user(user_config.raw); | ||
| 226 | } | ||
| 227 | return false; | ||
| 228 | } | ||
| 229 | |||
| 230 | return true; | ||
| 231 | } | ||
| 232 | |||
| 233 | bool rgb_matrix_indicators_user(void) { | ||
| 234 | HSV hsv = rgb_matrix_config.hsv; | ||
| 235 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 236 | hsv.h = time; | ||
| 237 | RGB rgb = hsv_to_rgb(hsv); | ||
| 238 | |||
| 239 | if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { | ||
| 240 | if (host_keyboard_led_state().caps_lock) { | ||
| 241 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 242 | } | ||
| 243 | if (host_keyboard_led_state().scroll_lock) { | ||
| 244 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 245 | } | ||
| 246 | } else { | ||
| 247 | if (host_keyboard_led_state().caps_lock) { | ||
| 248 | rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); | ||
| 249 | } else { | ||
| 250 | rgb_matrix_set_color(25, 0, 0, 0); | ||
| 251 | } | ||
| 252 | if (host_keyboard_led_state().scroll_lock) { | ||
| 253 | rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); | ||
| 254 | } else { | ||
| 255 | rgb_matrix_set_color(73, 0, 0, 0); | ||
| 256 | } | ||
| 257 | } | ||
| 258 | return false; | ||
| 259 | } | ||
| 260 | |||
| 261 | #ifdef OLED_ENABLE | 152 | #ifdef OLED_ENABLE |
| 262 | static void render_layer_info(void) { | 153 | static void render_layer_info(void) { |
| 263 | switch (get_highest_layer(layer_state)) { | 154 | switch (get_highest_layer(layer_state)) { |
diff --git a/keyboards/phage_studio/pila87/keymaps/default/keymap.c b/keyboards/phage_studio/pila87/keymaps/default/keymap.c index f2de085ca6..10f01dbae5 100644 --- a/keyboards/phage_studio/pila87/keymaps/default/keymap.c +++ b/keyboards/phage_studio/pila87/keymaps/default/keymap.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Copyright 2022 Phage Studio | 1 | /* Copyright 2023 Phage Studio |
| 2 | * Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | 2 | * Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 3 | * | 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| @@ -151,25 +151,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 151 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | 151 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
| 152 | ), | 152 | ), |
| 153 | }; | 153 | }; |
| 154 | |||
| 155 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 156 | switch (keycode) { | ||
| 157 | case RGB_TOG: | ||
| 158 | if (record->event.pressed) { | ||
| 159 | switch (rgb_matrix_get_flags()) { | ||
| 160 | case LED_FLAG_ALL: { | ||
| 161 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 162 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 163 | } | ||
| 164 | break; | ||
| 165 | default: { | ||
| 166 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 167 | rgb_matrix_enable_noeeprom(); | ||
| 168 | } | ||
| 169 | break; | ||
| 170 | } | ||
| 171 | } | ||
| 172 | return false; | ||
| 173 | } | ||
| 174 | return true; | ||
| 175 | } | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/config.h b/keyboards/phage_studio/pila87/keymaps/horrortroll/config.h deleted file mode 100644 index 04ddd591a5..0000000000 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/config.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | /* Forcing to use NKRO instead 6KRO */ | ||
| 20 | #define FORCE_NKRO | ||
| 21 | |||
| 22 | #define DYNAMIC_KEYMAP_LAYER_COUNT 2 | ||
| 23 | |||
| 24 | #ifdef RGB_MATRIX_ENABLE | ||
| 25 | #define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE | ||
| 26 | #endif | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap.c b/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap.c index 5528e28055..28de8ad449 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap.c +++ b/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap.c | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | 18 | ||
| 19 | #include "keymap_stuff.h" | 19 | #include "horrortroll.h" |
| 20 | 20 | ||
| 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 22 | 22 | ||
| @@ -55,8 +55,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 55 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, | 55 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, |
| 56 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, | 56 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, |
| 57 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, | 57 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, |
| 58 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | 58 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, |
| 59 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | 59 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, |
| 60 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | 60 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT |
| 61 | ), | 61 | ), |
| 62 | 62 | ||
| @@ -86,3 +86,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 86 | _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI | 86 | _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI |
| 87 | ), | 87 | ), |
| 88 | }; | 88 | }; |
| 89 | |||
| 90 | #ifdef RGB_MATRIX_ENABLE | ||
| 91 | |||
| 92 | #include <string.h> | ||
| 93 | #include <math.h> | ||
| 94 | #include <lib/lib8tion/lib8tion.h> | ||
| 95 | |||
| 96 | bool rgb_matrix_indicators_user(void) { | ||
| 97 | HSV hsv = rgb_matrix_config.hsv; | ||
| 98 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 99 | hsv.h = time; | ||
| 100 | RGB rgb = hsv_to_rgb(hsv); | ||
| 101 | |||
| 102 | if (host_keyboard_led_state().caps_lock) { | ||
| 103 | rgb_matrix_set_color(40, rgb.r, rgb.g, rgb.b); | ||
| 104 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 105 | rgb_matrix_set_color(40, 0, 0, 0); | ||
| 106 | } | ||
| 107 | |||
| 108 | if (host_keyboard_led_state().scroll_lock) { | ||
| 109 | rgb_matrix_set_color(89, rgb.r, rgb.g, rgb.b); | ||
| 110 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 111 | rgb_matrix_set_color(89, 0, 0, 0); | ||
| 112 | } | ||
| 113 | return false; | ||
| 114 | } | ||
| 115 | #endif | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/flower_blooming/flower_blooming.c b/keyboards/phage_studio/pila87/keymaps/horrortroll/led/flower_blooming/flower_blooming.c deleted file mode 100644 index add83149cc..0000000000 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/flower_blooming/flower_blooming.c +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "led/flower_blooming/flower_blooming.h" | ||
| 18 | |||
| 19 | static HSV FLOWER_BLOOMING_math(HSV hsv, uint8_t i, uint8_t time) { | ||
| 20 | if (g_led_config.point[i].y > k_rgb_matrix_center.y) | ||
| 21 | hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 + time; | ||
| 22 | else | ||
| 23 | hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 - time; | ||
| 24 | return hsv; | ||
| 25 | } | ||
| 26 | |||
| 27 | bool FLOWER_BLOOMING(effect_params_t* params) { return effect_runner_bloom(params, &FLOWER_BLOOMING_math); } | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/kitt.c b/keyboards/phage_studio/pila87/keymaps/horrortroll/led/kitt.c deleted file mode 100644 index 432eb117f2..0000000000 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/kitt.c +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | /* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | // variable for startup animation | ||
| 18 | bool BASE_EFFECT_NOT_STARTED_YET = true; | ||
| 19 | uint8_t base_effect_startup_counter = 255; | ||
| 20 | |||
| 21 | uint8_t led_count = 11; | ||
| 22 | uint8_t led_first = 29; | ||
| 23 | |||
| 24 | static uint8_t time_to_led(uint8_t time, uint8_t led_behind) { | ||
| 25 | uint16_t led_time = led_count * time; | ||
| 26 | uint16_t step = ((2 * led_count + (led_time / 128)) - led_behind) % (2 * led_count); | ||
| 27 | uint8_t led; | ||
| 28 | |||
| 29 | if (step < led_count) { | ||
| 30 | led = step; | ||
| 31 | } else { | ||
| 32 | led = led_count - 1 - (step - led_count); | ||
| 33 | } | ||
| 34 | |||
| 35 | return led; | ||
| 36 | } | ||
| 37 | |||
| 38 | static HSV KITT_math(HSV hsv, uint8_t i, uint8_t time) { | ||
| 39 | |||
| 40 | // reset base effect startup | ||
| 41 | if (i == 0) { | ||
| 42 | BASE_EFFECT_NOT_STARTED_YET = true; | ||
| 43 | } | ||
| 44 | |||
| 45 | hsv.h = 0; | ||
| 46 | hsv.s = 255; | ||
| 47 | |||
| 48 | if (i >= led_first && i < led_first + led_count) { | ||
| 49 | uint8_t j = i - led_first; | ||
| 50 | if (j == time_to_led(time, 0)) { | ||
| 51 | hsv.v = hsv.v; | ||
| 52 | } else if (j == time_to_led(time, 1)) { | ||
| 53 | hsv.v = hsv.v/2; | ||
| 54 | } else if (j == time_to_led(time, 2)) { | ||
| 55 | hsv.v = hsv.v/4; | ||
| 56 | } else if (j == time_to_led(time, 3)) { | ||
| 57 | hsv.v = hsv.v/8; | ||
| 58 | } else { | ||
| 59 | hsv.v = 0; | ||
| 60 | } | ||
| 61 | } else { | ||
| 62 | hsv.v = 0; | ||
| 63 | } | ||
| 64 | |||
| 65 | return hsv; | ||
| 66 | } | ||
| 67 | |||
| 68 | bool KITT(effect_params_t* params) { return effect_runner_i(params, &KITT_math); } | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/readme.md b/keyboards/phage_studio/pila87/keymaps/horrortroll/readme.md deleted file mode 100644 index 8e0d1974fa..0000000000 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/readme.md +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | # My personal keymap with VIA and custom LED | ||
| 2 | |||
| 3 | ### Custom LED effect list: | ||
| 4 | |||
| 5 | - Custom gradient ([ported from SirTimmyTimbit code](https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt)) | ||
| 6 | - Cool diagonal ([ported from pleasuretek code](https://github.com/pleasuretek/qmk_firmware)) | ||
| 7 | - Flower Blooming | ||
| 8 | - Knight Rider ([ported from jumper149 code](https://github.com/jumper149/qmk_firmware/blob/jumper149/keyboards/dztech/dz65rgb/keymaps/jumper149/)) | ||
| 9 | - Random breath rainbow ([based from daed code](https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed) and modify by me) | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/rules.mk b/keyboards/phage_studio/pila87/keymaps/horrortroll/rules.mk deleted file mode 100644 index d475530c87..0000000000 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/rules.mk +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | |||
| 3 | RGB_MATRIX_CUSTOM_USER = yes | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/via/keymap.c b/keyboards/phage_studio/pila87/keymaps/via/keymap.c index f2de085ca6..10f01dbae5 100644 --- a/keyboards/phage_studio/pila87/keymaps/via/keymap.c +++ b/keyboards/phage_studio/pila87/keymaps/via/keymap.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Copyright 2022 Phage Studio | 1 | /* Copyright 2023 Phage Studio |
| 2 | * Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | 2 | * Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 3 | * | 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| @@ -151,25 +151,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 151 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | 151 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
| 152 | ), | 152 | ), |
| 153 | }; | 153 | }; |
| 154 | |||
| 155 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 156 | switch (keycode) { | ||
| 157 | case RGB_TOG: | ||
| 158 | if (record->event.pressed) { | ||
| 159 | switch (rgb_matrix_get_flags()) { | ||
| 160 | case LED_FLAG_ALL: { | ||
| 161 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 162 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 163 | } | ||
| 164 | break; | ||
| 165 | default: { | ||
| 166 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 167 | rgb_matrix_enable_noeeprom(); | ||
| 168 | } | ||
| 169 | break; | ||
| 170 | } | ||
| 171 | } | ||
| 172 | return false; | ||
| 173 | } | ||
| 174 | return true; | ||
| 175 | } | ||
diff --git a/keyboards/phage_studio/pila87/pila87.c b/keyboards/phage_studio/pila87/pila87.c index c379be228e..23304c03bb 100644 --- a/keyboards/phage_studio/pila87/pila87.c +++ b/keyboards/phage_studio/pila87/pila87.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Copyright 2022 Phage Studio | 1 | /* Copyright 2023 Phage Studio |
| 2 | * Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | 2 | * Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 3 | * | 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| @@ -17,11 +17,12 @@ | |||
| 17 | 17 | ||
| 18 | #include "pila87.h" | 18 | #include "pila87.h" |
| 19 | 19 | ||
| 20 | #ifdef RGB_MATRIX_ENABLE | ||
| 21 | |||
| 20 | #include <string.h> | 22 | #include <string.h> |
| 21 | #include <math.h> | 23 | #include <math.h> |
| 22 | #include <lib/lib8tion/lib8tion.h> | 24 | #include <lib/lib8tion/lib8tion.h> |
| 23 | 25 | ||
| 24 | #ifdef RGB_MATRIX_ENABLE | ||
| 25 | led_config_t g_led_config = { { | 26 | led_config_t g_led_config = { { |
| 26 | { 75, NO_LED, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 }, | 27 | { 75, NO_LED, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 }, |
| 27 | { 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58 }, | 28 | { 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58 }, |
| @@ -44,7 +45,28 @@ led_config_t g_led_config = { { | |||
| 44 | 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | 45 | 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
| 45 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, | 46 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, |
| 46 | } }; | 47 | } }; |
| 47 | #endif | 48 | |
| 49 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 50 | switch (keycode) { | ||
| 51 | case RGB_TOG: | ||
| 52 | if (record->event.pressed) { | ||
| 53 | switch (rgb_matrix_get_flags()) { | ||
| 54 | case LED_FLAG_ALL: { | ||
| 55 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 56 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 57 | } | ||
| 58 | break; | ||
| 59 | default: { | ||
| 60 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 61 | rgb_matrix_enable_noeeprom(); | ||
| 62 | } | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | return false; | ||
| 67 | } | ||
| 68 | return process_record_user(keycode, record); | ||
| 69 | } | ||
| 48 | 70 | ||
| 49 | bool rgb_matrix_indicators_kb(void) { | 71 | bool rgb_matrix_indicators_kb(void) { |
| 50 | if (!rgb_matrix_indicators_user()) { | 72 | if (!rgb_matrix_indicators_user()) { |
| @@ -63,3 +85,4 @@ bool rgb_matrix_indicators_kb(void) { | |||
| 63 | } | 85 | } |
| 64 | return true; | 86 | return true; |
| 65 | } | 87 | } |
| 88 | #endif | ||
diff --git a/users/horrortroll/config.h b/users/horrortroll/config.h new file mode 100644 index 0000000000..50bc7da537 --- /dev/null +++ b/users/horrortroll/config.h | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | /* Forcing to use NKRO instead 6KRO */ | ||
| 20 | #define FORCE_NKRO | ||
| 21 | |||
| 22 | #define DYNAMIC_KEYMAP_LAYER_COUNT 2 | ||
| 23 | |||
| 24 | #if defined(__arm__) | ||
| 25 | #ifdef RGB_MATRIX_ENABLE | ||
| 26 | #define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE | ||
| 27 | #endif | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #if defined(__AVR_ATmega32U4__) | ||
| 31 | #define NO_ACTION_ONESHOT | ||
| 32 | |||
| 33 | #ifdef RGB_MATRIX_ENABLE | ||
| 34 | /* RGB Matrix effect */ | ||
| 35 | #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 36 | #undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
| 37 | #undef ENABLE_RGB_MATRIX_BAND_SAT | ||
| 38 | #undef ENABLE_RGB_MATRIX_BAND_VAL | ||
| 39 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 40 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
| 41 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 42 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
| 43 | #undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 44 | #undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 45 | #undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 46 | #undef ENABLE_RGB_MATRIX_DUAL_BEACON | ||
| 47 | #undef ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 48 | #undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 49 | #undef ENABLE_RGB_MATRIX_RAINDROPS | ||
| 50 | #undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 51 | #undef ENABLE_RGB_MATRIX_HUE_WAVE | ||
| 52 | #undef ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
| 53 | |||
| 54 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 55 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 56 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 57 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 58 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 59 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 60 | #undef ENABLE_RGB_MATRIX_SPLASH | ||
| 61 | #undef ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 62 | #undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 63 | #endif | ||
| 64 | #endif | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap_stuff.h b/users/horrortroll/horrortroll.c index e850ccfc2e..1152b2cc9d 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/keymap_stuff.h +++ b/users/horrortroll/horrortroll.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> | 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -14,19 +14,9 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <string.h> | 17 | #include "horrortroll.h" |
| 18 | #include <math.h> | ||
| 19 | #include <lib/lib8tion/lib8tion.h> | ||
| 20 | 18 | ||
| 21 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 19 | #include "rgb_matrix.h" |
| 22 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 23 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 24 | // entirely and just use numbers. | ||
| 25 | |||
| 26 | enum layer_names { | ||
| 27 | _BASE, | ||
| 28 | _FN, | ||
| 29 | }; | ||
| 30 | 20 | ||
| 31 | // For CUSTOM_GRADIENT | 21 | // For CUSTOM_GRADIENT |
| 32 | HSV gradient_0 = {205, 250, 255}; | 22 | HSV gradient_0 = {205, 250, 255}; |
| @@ -40,28 +30,6 @@ typedef struct { | |||
| 40 | bool reflected; | 30 | bool reflected; |
| 41 | } CUSTOM_PRESETS; | 31 | } CUSTOM_PRESETS; |
| 42 | 32 | ||
| 43 | enum layer_keycodes { | ||
| 44 | //Custom Gradient control keycode | ||
| 45 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
| 46 | G1_HUD, //Custom gradient color 1 hue decrease | ||
| 47 | G1_SAI, //Custom gradient color 1 saturation increase | ||
| 48 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
| 49 | G1_VAI, //Custom gradient color 1 value increase | ||
| 50 | G1_VAD, //Custom gradient color 1 value decrease | ||
| 51 | G2_HUI, //Custom gradient color 2 hue increase | ||
| 52 | G2_HUD, //Custom gradient color 2 hue decrease | ||
| 53 | G2_SAI, //Custom gradient color 2 saturation increase | ||
| 54 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
| 55 | G2_VAI, //Custom gradient color 2 value increase | ||
| 56 | G2_VAD, //Custom gradient color 2 value decrease | ||
| 57 | G_PRE, //Gradient presets | ||
| 58 | REF_G, //Toggle between linear and reflected gradient | ||
| 59 | G_FLIP, //Flip the gradient colors | ||
| 60 | |||
| 61 | //Custom led effect keycode | ||
| 62 | RGB_C_E, //Cycle user effect | ||
| 63 | }; | ||
| 64 | |||
| 65 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 33 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 66 | uint8_t color_adj_step = 5; | 34 | uint8_t color_adj_step = 5; |
| 67 | 35 | ||
| @@ -184,9 +152,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 184 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_FLOWER_BLOOMING); | 152 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_FLOWER_BLOOMING); |
| 185 | return false; | 153 | return false; |
| 186 | case RGB_MATRIX_CUSTOM_FLOWER_BLOOMING: | 154 | case RGB_MATRIX_CUSTOM_FLOWER_BLOOMING: |
| 187 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_KITT); | ||
| 188 | return false; | ||
| 189 | case RGB_MATRIX_CUSTOM_KITT: | ||
| 190 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); | 155 | rgb_matrix_mode(RGB_MATRIX_CUSTOM_RANDOM_BREATH_RAINBOW); |
| 191 | return false; | 156 | return false; |
| 192 | default: | 157 | default: |
| @@ -195,42 +160,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 195 | } | 160 | } |
| 196 | } | 161 | } |
| 197 | return false; | 162 | return false; |
| 198 | case RGB_TOG: | ||
| 199 | if (record->event.pressed) { | ||
| 200 | switch (rgb_matrix_get_flags()) { | ||
| 201 | case LED_FLAG_ALL: { | ||
| 202 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 203 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 204 | } | ||
| 205 | break; | ||
| 206 | default: { | ||
| 207 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 208 | rgb_matrix_enable_noeeprom(); | ||
| 209 | } | ||
| 210 | break; | ||
| 211 | } | ||
| 212 | } | ||
| 213 | return false; | ||
| 214 | } | 163 | } |
| 215 | return true; | 164 | return true; |
| 216 | } | 165 | } |
| 217 | |||
| 218 | bool rgb_matrix_indicators_user(void) { | ||
| 219 | HSV hsv = rgb_matrix_config.hsv; | ||
| 220 | uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); | ||
| 221 | hsv.h = time; | ||
| 222 | RGB rgb = hsv_to_rgb(hsv); | ||
| 223 | |||
| 224 | if (host_keyboard_led_state().caps_lock) { | ||
| 225 | rgb_matrix_set_color(40, rgb.r, rgb.g, rgb.b); | ||
| 226 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 227 | rgb_matrix_set_color(40, 0, 0, 0); | ||
| 228 | } | ||
| 229 | |||
| 230 | if (host_keyboard_led_state().scroll_lock) { | ||
| 231 | rgb_matrix_set_color(89, rgb.r, rgb.g, rgb.b); | ||
| 232 | } else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) { | ||
| 233 | rgb_matrix_set_color(89, 0, 0, 0); | ||
| 234 | } | ||
| 235 | return false; | ||
| 236 | } | ||
diff --git a/users/horrortroll/horrortroll.h b/users/horrortroll/horrortroll.h new file mode 100644 index 0000000000..a251f74d6c --- /dev/null +++ b/users/horrortroll/horrortroll.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "quantum.h" | ||
| 18 | |||
| 19 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 20 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 21 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 22 | // entirely and just use numbers. | ||
| 23 | |||
| 24 | enum layer_names { | ||
| 25 | _BASE, | ||
| 26 | _FN, | ||
| 27 | }; | ||
| 28 | |||
| 29 | enum custom_keycodes { | ||
| 30 | //Custom Gradient control keycode | ||
| 31 | G1_HUI = SAFE_RANGE, //Custom gradient color 1 hue increase | ||
| 32 | G1_HUD, //Custom gradient color 1 hue decrease | ||
| 33 | G1_SAI, //Custom gradient color 1 saturation increase | ||
| 34 | G1_SAD, //Custom gradient color 1 saturation decrease | ||
| 35 | G1_VAI, //Custom gradient color 1 value increase | ||
| 36 | G1_VAD, //Custom gradient color 1 value decrease | ||
| 37 | G2_HUI, //Custom gradient color 2 hue increase | ||
| 38 | G2_HUD, //Custom gradient color 2 hue decrease | ||
| 39 | G2_SAI, //Custom gradient color 2 saturation increase | ||
| 40 | G2_SAD, //Custom gradient color 2 saturation decrease | ||
| 41 | G2_VAI, //Custom gradient color 2 value increase | ||
| 42 | G2_VAD, //Custom gradient color 2 value decrease | ||
| 43 | G_PRE, //Gradient presets | ||
| 44 | REF_G, //Toggle between linear and reflected gradient | ||
| 45 | G_FLIP, //Flip the gradient colors | ||
| 46 | |||
| 47 | //Custom led effect keycode | ||
| 48 | RGB_C_E, //Cycle user effect | ||
| 49 | }; | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/cool_diagonal.c b/users/horrortroll/led/cool_diagonal.c index 900130aba5..900130aba5 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/cool_diagonal.c +++ b/users/horrortroll/led/cool_diagonal.c | |||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/custom_gradient.c b/users/horrortroll/led/custom_gradient.c index af6173d250..af6173d250 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/custom_gradient.c +++ b/users/horrortroll/led/custom_gradient.c | |||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/flower_blooming/flower_blooming.c b/users/horrortroll/led/flower_blooming/flower_blooming.c index add83149cc..add83149cc 100644 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/flower_blooming/flower_blooming.c +++ b/users/horrortroll/led/flower_blooming/flower_blooming.c | |||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/flower_blooming/flower_blooming.h b/users/horrortroll/led/flower_blooming/flower_blooming.h index ccdaa70d97..ccdaa70d97 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/flower_blooming/flower_blooming.h +++ b/users/horrortroll/led/flower_blooming/flower_blooming.h | |||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/random_breath_rainbow.c b/users/horrortroll/led/random_breath_rainbow.c index ba1ca55faf..ba1ca55faf 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/led/random_breath_rainbow.c +++ b/users/horrortroll/led/random_breath_rainbow.c | |||
diff --git a/keyboards/gopolar/gg86/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.c b/users/horrortroll/readme.md index ce3fff8ec5..420c9b0986 100644 --- a/keyboards/gopolar/gg86/keymaps/horrortroll/led/rainbow_reactive_simple/rainbow_reactive_simple.c +++ b/users/horrortroll/readme.md | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> | 1 | /* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -14,12 +14,11 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "led/rainbow_reactive_simple/rainbow_reactive_simple.h" | 17 | # My personal keymap with custom LED |
| 18 | 18 | ||
| 19 | static HSV RAINBOW_REACTIVE_SIMPLE_math(HSV hsv, uint8_t i, uint8_t time, uint16_t offset) { | 19 | ### Custom LED effect list: |
| 20 | hsv.h = g_led_config.point[i].x - time; | ||
| 21 | hsv.v = scale8(255 - offset, hsv.v); | ||
| 22 | return hsv; | ||
| 23 | } | ||
| 24 | 20 | ||
| 25 | bool RAINBOW_REACTIVE_SIMPLE(effect_params_t* params) { return effect_rainbow_reactive(params, &RAINBOW_REACTIVE_SIMPLE_math); } \ No newline at end of file | 21 | - Custom gradient ([ported from SirTimmyTimbit code](https://github.com/SirTimmyTimbit/customizable-gradient-effect-for-drop-alt)) |
| 22 | - Cool diagonal ([ported from pleasuretek code](https://github.com/pleasuretek/qmk_firmware)) | ||
| 23 | - Flower Blooming | ||
| 24 | - Random breath rainbow ([based from daed code](https://github.com/daed/qmk_firmware/blob/master/keyboards/massdrop/alt/keymaps/daed) and modify by me) | ||
diff --git a/keyboards/phage_studio/pila87/keymaps/horrortroll/rgb_matrix_user.inc b/users/horrortroll/rgb_matrix_user.inc index 1e09e3f0c1..08c608dc44 100644 --- a/keyboards/phage_studio/pila87/keymaps/horrortroll/rgb_matrix_user.inc +++ b/users/horrortroll/rgb_matrix_user.inc | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) | 1 | RGB_MATRIX_EFFECT(CUSTOM_GRADIENT) |
| 2 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) | 2 | RGB_MATRIX_EFFECT(COOL_DIAGONAL) |
| 3 | RGB_MATRIX_EFFECT(FLOWER_BLOOMING) | 3 | RGB_MATRIX_EFFECT(FLOWER_BLOOMING) |
| 4 | RGB_MATRIX_EFFECT(KITT) | ||
| 5 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | 4 | RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) |
| 6 | 5 | ||
| 7 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | 6 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| @@ -9,7 +8,6 @@ RGB_MATRIX_EFFECT(RANDOM_BREATH_RAINBOW) | |||
| 9 | #include "led/custom_gradient.c" | 8 | #include "led/custom_gradient.c" |
| 10 | #include "led/cool_diagonal.c" | 9 | #include "led/cool_diagonal.c" |
| 11 | #include "led/flower_blooming/flower_blooming.c" | 10 | #include "led/flower_blooming/flower_blooming.c" |
| 12 | #include "led/kitt.c" | ||
| 13 | #include "led/random_breath_rainbow.c" | 11 | #include "led/random_breath_rainbow.c" |
| 14 | 12 | ||
| 15 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | 13 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
diff --git a/users/horrortroll/rules.mk b/users/horrortroll/rules.mk new file mode 100644 index 0000000000..579f5fd38b --- /dev/null +++ b/users/horrortroll/rules.mk | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | RGB_MATRIX_CUSTOM_USER = yes | ||
| 3 | |||
| 4 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) | ||
| 5 | SRC += $(USER_PATH)/horrortroll.c | ||
| 6 | endif | ||
