aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-09-07 08:57:30 -0700
committerGitHub <noreply@github.com>2019-09-07 08:57:30 -0700
commite88f80a891138d40acddcdd2b3dface8b2a57404 (patch)
tree1fa1e8cd0bd15d10970ce55efceaffcddaf01160 /users
parent79a6c6eda50671b28f32dfb73728fcc1671fe4fc (diff)
downloadqmk_firmware-e88f80a891138d40acddcdd2b3dface8b2a57404.tar.gz
qmk_firmware-e88f80a891138d40acddcdd2b3dface8b2a57404.zip
[Keymap] Big Drashna code update (#6639)
* Add a quefrency keymap * New Alt-ernate layouts * Enable Per Key Tapping Term to preserve sanity * Use underglow and mod lights for status on Corne * Update the drashna_ms keymap for quefrency * Disable Audio since there isn't enough space * Update KC_MAKE to ues :flash target * Cleanup ergodox layout * Enable i2c support for Iris * Add keymap support for CG_SWAP * Enable RGB Matrix Shutdown mode * enable heatmap * Update gitlab CI to install python3 * Remove game macros These are no longer needed, and haven't been used in ages * Cleanup planck layout * Add RGB Matrix fun and RGB cleanup * Add keycode and config for RGB Matrix idle animations * Clean up rgb idle animation code * Add rgb idle keycode to keymaps * Fix issues with rgb matrix idle animation * Fix some handling for idle animation * Reduce idle animation timeout to 15s to be more reasonable * fix up rgb stuff * Fix isses with rgb functions not being called for matrix * Use custom EEPROM Magic Number so testing is easier * Extend Default Layer macro to support a lot more layers * Fix bjohnson macropad * Adjust KC_MAKE to process mods for more consistent behavior * Fix up rgb stuff on corne * Corne OLED Overhaul * Fixes a number of issues with weirdness. * Fixes issues with keylogger (should be more reliable now) * Modulaize the OLED render sections * Rewrite layer display code * Update URL for Font Editor Due to odd issues, I ended up rewriting from scratch. And using PROGMEM versions, since I think I was getting memory overflows. * Update polling rate on all keebs * Fix planck ez layout config * Remove macros from Viterbi
Diffstat (limited to 'users')
-rw-r--r--users/drashna/.gitlab-ci.yml2
-rw-r--r--users/drashna/config.h6
-rw-r--r--users/drashna/drashna.c37
-rw-r--r--users/drashna/drashna.h16
-rw-r--r--users/drashna/process_records.c63
-rw-r--r--users/drashna/process_records.h17
-rw-r--r--users/drashna/rgb_stuff.c97
-rw-r--r--users/drashna/rgb_stuff.h13
-rw-r--r--users/drashna/rules.mk4
-rw-r--r--users/drashna/wrappers.h4
10 files changed, 128 insertions, 131 deletions
diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml
index 679bdf435..7218a21be 100644
--- a/users/drashna/.gitlab-ci.yml
+++ b/users/drashna/.gitlab-ci.yml
@@ -10,7 +10,7 @@ QMK Firmware:
10 image: ubuntu:18.10 10 image: ubuntu:18.10
11 before_script: 11 before_script:
12 - apt-get update -qy 12 - apt-get update -qy
13 - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr unzip wget zip 13 - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip
14 - avr-gcc --version 14 - avr-gcc --version
15 - uname -a 15 - uname -a
16 script: 16 script:
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 8f6e700d2..a0f92d8f3 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -1,5 +1,11 @@
1#pragma once 1#pragma once
2 2
3// Use custom magic number so that when switching branches, EEPROM always gets reset
4#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1337
5
6/* Set Polling rate to 1000Hz */
7#define USB_POLLING_INTERVAL_MS 1
8
3#ifdef AUDIO_ENABLE 9#ifdef AUDIO_ENABLE
4# if __GNUC__ > 7 10# if __GNUC__ > 7
5# if __has_include("drashna_song_list.h") 11# if __has_include("drashna_song_list.h")
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index c1809dad0..6a436e0af 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -25,26 +25,7 @@ userspace_config_t userspace_config;
25# define DRASHNA_UNICODE_MODE 2 25# define DRASHNA_UNICODE_MODE 2
26#endif 26#endif
27 27
28// This block is for all of the gaming macros, as they were all doing 28
29// the same thing, but with differring text sent.
30bool send_game_macro(const char *str, keyrecord_t *record, bool override) {
31 if (!record->event.pressed || override) {
32 uint16_t keycode;
33 if (userspace_config.is_overwatch) {
34 keycode = KC_BSPC;
35 } else {
36 keycode = KC_ENTER;
37 }
38 clear_keyboard();
39 tap_code(keycode);
40 wait_ms(TAP_CODE_DELAY);
41 send_string_with_delay(str, TAP_CODE_DELAY);
42 wait_ms(TAP_CODE_DELAY);
43 tap_code(KC_ENTER);
44 }
45 if (override) wait_ms(3000);
46 return false;
47}
48 29
49bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { 30bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) {
50 static uint16_t this_timer; 31 static uint16_t this_timer;
@@ -123,7 +104,7 @@ __attribute__((weak))
123void keyboard_post_init_keymap(void) {} 104void keyboard_post_init_keymap(void) {}
124 105
125void keyboard_post_init_user(void) { 106void keyboard_post_init_user(void) {
126#ifdef RGBLIGHT_ENABLE 107#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
127 keyboard_post_init_rgb(); 108 keyboard_post_init_rgb();
128#endif 109#endif
129 keyboard_post_init_keymap(); 110 keyboard_post_init_keymap();
@@ -132,6 +113,8 @@ void keyboard_post_init_user(void) {
132__attribute__((weak)) 113__attribute__((weak))
133void shutdown_keymap(void) {} 114void shutdown_keymap(void) {}
134 115
116 void rgb_matrix_update_pwm_buffers(void);
117
135void shutdown_user(void) { 118void shutdown_user(void) {
136#ifdef RGBLIGHT_ENABLE 119#ifdef RGBLIGHT_ENABLE
137 rgblight_enable_noeeprom(); 120 rgblight_enable_noeeprom();
@@ -139,9 +122,9 @@ void shutdown_user(void) {
139 rgblight_setrgb_red(); 122 rgblight_setrgb_red();
140#endif // RGBLIGHT_ENABLE 123#endif // RGBLIGHT_ENABLE
141#ifdef RGB_MATRIX_ENABLE 124#ifdef RGB_MATRIX_ENABLE
142 // uint16_t timer_start = timer_read(); 125 rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 );
143 // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); 126 rgb_matrix_update_pwm_buffers();
144 // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } 127
145#endif // RGB_MATRIX_ENABLE 128#endif // RGB_MATRIX_ENABLE
146 shutdown_keymap(); 129 shutdown_keymap();
147} 130}
@@ -176,7 +159,7 @@ void matrix_scan_user(void) {
176 run_diablo_macro_check(); 159 run_diablo_macro_check();
177#endif // TAP_DANCE_ENABLE 160#endif // TAP_DANCE_ENABLE
178 161
179#ifdef RGBLIGHT_ENABLE 162#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
180 matrix_scan_rgb(); 163 matrix_scan_rgb();
181#endif // RGBLIGHT_ENABLE 164#endif // RGBLIGHT_ENABLE
182 165
@@ -190,7 +173,7 @@ layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
190// Then runs keymap's layer change check 173// Then runs keymap's layer change check
191layer_state_t layer_state_set_user(layer_state_t state) { 174layer_state_t layer_state_set_user(layer_state_t state) {
192 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); 175 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
193#ifdef RGBLIGHT_ENABLE 176#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
194 state = layer_state_set_rgb(state); 177 state = layer_state_set_rgb(state);
195#endif // RGBLIGHT_ENABLE 178#endif // RGBLIGHT_ENABLE
196 return layer_state_set_keymap(state); 179 return layer_state_set_keymap(state);
@@ -203,7 +186,7 @@ layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state
203layer_state_t default_layer_state_set_user(layer_state_t state) { 186layer_state_t default_layer_state_set_user(layer_state_t state) {
204 state = default_layer_state_set_keymap(state); 187 state = default_layer_state_set_keymap(state);
205#if 0 188#if 0
206# ifdef RGBLIGHT_ENABLE 189#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
207 state = default_layer_state_set_rgb(state); 190 state = default_layer_state_set_rgb(state);
208# endif // RGBLIGHT_ENABLE 191# endif // RGBLIGHT_ENABLE
209#endif 192#endif
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index 0d6dac380..e3edf8112 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -49,13 +49,8 @@ enum userspace_layers {
49 _ADJUST, 49 _ADJUST,
50}; 50};
51 51
52/*
53define modifiers here, since MOD_* doesn't seem to work for these
54 */
55
56bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); 52bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
57bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); 53bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
58bool send_game_macro(const char *str, keyrecord_t *record, bool override);
59void matrix_init_keymap(void); 54void matrix_init_keymap(void);
60void shutdown_keymap(void); 55void shutdown_keymap(void);
61void suspend_power_down_keymap(void); 56void suspend_power_down_keymap(void);
@@ -69,11 +64,12 @@ void eeconfig_init_keymap(void);
69typedef union { 64typedef union {
70 uint32_t raw; 65 uint32_t raw;
71 struct { 66 struct {
72 bool rgb_layer_change :1; 67 bool rgb_layer_change :1;
73 bool is_overwatch :1; 68 bool is_overwatch :1;
74 bool nuke_switch :1; 69 bool nuke_switch :1;
75 uint8_t unicode_mod :4; 70 uint8_t unicode_mod :4;
76 bool swapped_numbers :1; 71 bool swapped_numbers :1;
72 bool rgb_matrix_idle_anim :1;
77 }; 73 };
78} userspace_config_t; 74} userspace_config_t;
79 75
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c
index 5666d052d..6eb21d2f2 100644
--- a/users/drashna/process_records.c
+++ b/users/drashna/process_records.c
@@ -21,16 +21,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
21#endif // KEYLOGGER_ENABLE 21#endif // KEYLOGGER_ENABLE
22 22
23 switch (keycode) { 23 switch (keycode) {
24 case KC_QWERTY ... KC_CARPLAX: 24 case KC_QWERTY ... KC_WORKMAN:
25 if (record->event.pressed) { 25 if (record->event.pressed) {
26 set_single_persistent_default_layer(keycode - KC_QWERTY); 26 uint8_t mods = mod_config(get_mods()|get_oneshot_mods());
27 if (!mods) {
28 set_single_persistent_default_layer(keycode - KC_QWERTY);
29 } else if (mods & MOD_MASK_SHIFT) {
30 set_single_persistent_default_layer(keycode - KC_QWERTY + 4);
31 } else if (mods & MOD_MASK_CTRL) {
32 set_single_persistent_default_layer(keycode - KC_QWERTY + 8);
33 }
27 } 34 }
28 break; 35 break;
29 36
30 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader 37 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
31 if (!record->event.pressed) { 38 if (!record->event.pressed) {
32 uint8_t temp_mod = get_mods(); 39 uint8_t temp_mod = mod_config(get_mods());
33 uint8_t temp_osm = get_oneshot_mods(); 40 uint8_t temp_osm = mod_config(get_oneshot_mods());
34 clear_mods(); 41 clear_mods();
35 clear_oneshot_mods(); 42 clear_oneshot_mods();
36 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); 43 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY);
@@ -38,15 +45,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
38 if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) 45 if ((temp_mod | temp_osm) & MOD_MASK_SHIFT)
39#endif 46#endif
40 { 47 {
41#if defined(__arm__) 48 send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY);
42 send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY);
43#elif defined(BOOTLOADER_DFU)
44 send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY);
45#elif defined(BOOTLOADER_HALFKAY)
46 send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY);
47#elif defined(BOOTLOADER_CATERINA)
48 send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY);
49#endif // bootloader options
50 } 49 }
51 if ((temp_mod | temp_osm) & MOD_MASK_CTRL) { 50 if ((temp_mod | temp_osm) & MOD_MASK_CTRL) {
52 send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); 51 send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY);
@@ -68,44 +67,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
68 } 67 }
69 break; 68 break;
70 69
71 // These are a serious of gaming macros.
72 // Only enables for the viterbi, basically,
73 // to save on firmware space, since it's limited.
74#ifdef MACROS_ENABLED
75 case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
76 if (record->event.pressed) {
77 userspace_config.is_overwatch ^= 1;
78 eeconfig_update_user(userspace_config.raw);
79 }
80# ifdef RGBLIGHT_ENABLE
81 userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
82# endif // RGBLIGHT_ENABLE
83 break;
84 case KC_SALT:
85 return send_game_macro("Salt, salt, salt...", record, false);
86 case KC_MORESALT:
87 return send_game_macro("Please sir, can I have some more salt?!", record, false);
88 case KC_SALTHARD:
89 return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false);
90 case KC_GOODGAME:
91 return send_game_macro("Good game, everyone!", record, false);
92 case KC_GLHF:
93 return send_game_macro("Good luck, have fun!!!", record, false);
94 case KC_SYMM:
95 return send_game_macro("Left click to win!", record, false);
96 case KC_JUSTGAME:
97 return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false);
98 case KC_TORB:
99 return send_game_macro("That was positively riveting!", record, false);
100 case KC_AIM:
101 send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true);
102 return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false);
103 case KC_C9:
104 return send_game_macro("OMG!!! C9!!!", record, false);
105 case KC_GGEZ:
106 return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false);
107#endif // MACROS_ENABLED
108
109 case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them 70 case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
110#ifdef TAP_DANCE_ENABLE 71#ifdef TAP_DANCE_ENABLE
111 if (record->event.pressed) { 72 if (record->event.pressed) {
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h
index 8901a6f91..0ae468a04 100644
--- a/users/drashna/process_records.h
+++ b/users/drashna/process_records.h
@@ -13,25 +13,10 @@ enum userspace_custom_keycodes {
13 KC_COLEMAK, // Sets default layer to COLEMAK 13 KC_COLEMAK, // Sets default layer to COLEMAK
14 KC_DVORAK, // Sets default layer to DVORAK 14 KC_DVORAK, // Sets default layer to DVORAK
15 KC_WORKMAN, // Sets default layer to WORKMAN 15 KC_WORKMAN, // Sets default layer to WORKMAN
16 KC_NORMAN, // Sets default layer to NORMAN
17 KC_MALTRON, // Sets default layer to MALTRON
18 KC_EUCALYN, // Sets default layer to EUCALYN
19 KC_CARPLAX, // Sets default layer to CARPLAX
20 KC_DIABLO_CLEAR, // Clears all Diablo Timers 16 KC_DIABLO_CLEAR, // Clears all Diablo Timers
21 KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat)
22 KC_SALT, // See drashna.c for details
23 KC_MORESALT,
24 KC_SALTHARD,
25 KC_GOODGAME,
26 KC_SYMM,
27 KC_JUSTGAME,
28 KC_GLHF,
29 KC_TORB,
30 KC_AIM,
31 KC_C9,
32 KC_GGEZ,
33 KC_MAKE, // Run keyboard's customized make command 17 KC_MAKE, // Run keyboard's customized make command
34 KC_RGB_T, // Toggles RGB Layer Indication mode 18 KC_RGB_T, // Toggles RGB Layer Indication mode
19 RGB_IDL, // RGB Idling animations
35 KC_SECRET_1, // test1 20 KC_SECRET_1, // test1
36 KC_SECRET_2, // test2 21 KC_SECRET_2, // test2
37 KC_SECRET_3, // test3 22 KC_SECRET_3, // test3
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 12851e261..a9af0566e 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -5,12 +5,24 @@
5#if defined(RGBLIGHT_ENABLE) 5#if defined(RGBLIGHT_ENABLE)
6extern rgblight_config_t rgblight_config; 6extern rgblight_config_t rgblight_config;
7bool has_initialized; 7bool has_initialized;
8#endif
9 8
10#ifdef RGBLIGHT_ENABLE
11void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } 9void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); }
12#endif // RGBLIGHT_ENABLE 10#endif // RGBLIGHT_ENABLE
13 11
12#if defined(RGB_MATRIX_ENABLE)
13static uint32_t hypno_timer;
14# if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd)
15# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
16# else
17# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
18# endif
19#endif
20
21/* Custom indicators for modifiers.
22 * This allows for certain lights to be lit up, based on what mods are active, giving some visual feedback.
23 * This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up.
24 */
25#ifdef RGBLIGHT_ENABLE
14#ifdef INDICATOR_LIGHTS 26#ifdef INDICATOR_LIGHTS
15void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { 27void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
16 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { 28 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
@@ -77,6 +89,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
77 } 89 }
78} 90}
79 91
92/* Function for the indicators */
80void matrix_scan_indicator(void) { 93void matrix_scan_indicator(void) {
81 if (has_initialized) { 94 if (has_initialized) {
82 set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); 95 set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
@@ -89,6 +102,7 @@ static rgblight_fadeout lights[RGBLED_NUM];
89 102
90__attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } 103__attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; }
91 104
105/* This function checks for used LEDs. This way, collisions don't occur and cause weird rendering */
92bool rgblight_twinkle_is_led_used(uint8_t index) { 106bool rgblight_twinkle_is_led_used(uint8_t index) {
93 switch (index) { 107 switch (index) {
94# ifdef INDICATOR_LIGHTS 108# ifdef INDICATOR_LIGHTS
@@ -130,6 +144,7 @@ bool rgblight_twinkle_is_led_used(uint8_t index) {
130 } 144 }
131} 145}
132 146
147/* Handler for fading/twinkling effect */
133void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive 148void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
134 bool litup = false; 149 bool litup = false;
135 for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { 150 for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
@@ -156,6 +171,9 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rg
156 } 171 }
157} 172}
158 173
174/* Triggers a LED to fade/twinkle.
175 * This function handles the selection of the LED and prepres for it to be used.
176 */
159void start_rgb_light(void) { 177void start_rgb_light(void) {
160 uint8_t indices[RGBLED_NUM]; 178 uint8_t indices[RGBLED_NUM];
161 uint8_t indices_count = 0; 179 uint8_t indices_count = 0;
@@ -194,12 +212,23 @@ void start_rgb_light(void) {
194 rgblight_sethsv_at(light->hue, 255, light->life, light_index); 212 rgblight_sethsv_at(light->hue, 255, light->life, light_index);
195} 213}
196#endif 214#endif
215#endif // RGBLIGHT_ENABLE
197 216
198bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { 217bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
218 uint16_t temp_keycode = keycode;
219 // Filter out the actual keycode from MT and LT keys.
199 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { 220 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
200 keycode = keycode & 0xFF; 221 temp_keycode &= 0xFF;
201 } 222 }
202 switch (keycode) { 223
224#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
225 hypno_timer = timer_read32();
226 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) {
227 rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
228 }
229#endif
230
231 switch (temp_keycode) {
203#ifdef RGBLIGHT_TWINKLE 232#ifdef RGBLIGHT_TWINKLE
204 case KC_A ... KC_SLASH: 233 case KC_A ... KC_SLASH:
205 case KC_F1 ... KC_F12: 234 case KC_F1 ... KC_F12:
@@ -210,40 +239,58 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
210 if (record->event.pressed) { 239 if (record->event.pressed) {
211 start_rgb_light(); 240 start_rgb_light();
212 } 241 }
213 return true;
214 break; 242 break;
215#endif // RGBLIGHT_TWINKLE 243#endif // RGBLIGHT_TWINKLE
216 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal 244 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
217#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 245#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
218 if (record->event.pressed) { 246 if (record->event.pressed) {
219 userspace_config.rgb_layer_change ^= 1; 247 userspace_config.rgb_layer_change ^= 1;
220 xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); 248 dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
221 eeconfig_update_user(userspace_config.raw); 249 eeconfig_update_user(userspace_config.raw);
222 if (userspace_config.rgb_layer_change) { 250 if (userspace_config.rgb_layer_change) {
223 layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) 251 layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
224 } 252 }
225 } 253 }
226#endif // RGBLIGHT_ENABLE 254#endif // RGBLIGHT_ENABLE
227 return false;
228 break; 255 break;
229#ifdef RGBLIGHT_ENABLE 256 case RGB_IDL: // This allows me to use underglow as layer indication, or as normal
257#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
258 if (record->event.pressed) {
259 userspace_config.rgb_matrix_idle_anim ^= 1;
260 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
261 eeconfig_update_user(userspace_config.raw);
262 if (userspace_config.rgb_matrix_idle_anim) { rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); }
263 }
264#endif
265 break;
230 case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions 266 case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
231 if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled 267 if (record->event.pressed) {
268 bool is_eeprom_updated = false;
269#ifdef RGBLIGHT_ENABLE
270 // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
232 if (userspace_config.rgb_layer_change) { 271 if (userspace_config.rgb_layer_change) {
233 userspace_config.rgb_layer_change = false; 272 userspace_config.rgb_layer_change = false;
234 xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); 273 dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
235 eeconfig_update_user(userspace_config.raw); 274 is_eeprom_updated = true;
236 } 275 }
276#endif
277#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
278 if (userspace_config.rgb_matrix_idle_anim) {
279 userspace_config.rgb_matrix_idle_anim = false;
280 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
281 is_eeprom_updated = true;
282 }
283#endif
284 if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); }
237 } 285 }
238 return true;
239 break; 286 break;
240#endif // RGBLIGHT_ENABLE
241 } 287 }
242 return true; 288 return true;
243} 289}
244 290
245void keyboard_post_init_rgb(void) { 291void keyboard_post_init_rgb(void) {
246#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) 292#if defined(RGBLIGHT_ENABLE)
293# if defined(RGBLIGHT_STARTUP_ANIMATION)
247 bool is_enabled = rgblight_config.enable; 294 bool is_enabled = rgblight_config.enable;
248 if (userspace_config.rgb_layer_change) { 295 if (userspace_config.rgb_layer_change) {
249 rgblight_enable_noeeprom(); 296 rgblight_enable_noeeprom();
@@ -262,17 +309,31 @@ void keyboard_post_init_rgb(void) {
262 rgblight_disable_noeeprom(); 309 rgblight_disable_noeeprom();
263 } 310 }
264 311
265#endif 312# endif
266 layer_state_set_user(layer_state); 313 layer_state_set_user(layer_state);
314#endif
315#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
316 if (userspace_config.rgb_matrix_idle_anim) {
317 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
318 }
319#endif
267} 320}
268 321
269void matrix_scan_rgb(void) { 322void matrix_scan_rgb(void) {
270#ifdef RGBLIGHT_TWINKLE 323#ifdef RGBLIGHT_ENABLE
324# ifdef RGBLIGHT_TWINKLE
271 scan_rgblight_fadeout(); 325 scan_rgblight_fadeout();
272#endif // RGBLIGHT_ENABLE 326# endif // RGBLIGHT_ENABLE
273 327
274#ifdef INDICATOR_LIGHTS 328# ifdef INDICATOR_LIGHTS
275 matrix_scan_indicator(); 329 matrix_scan_indicator();
330# endif
331#endif
332
333#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
334 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) {
335 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
336 }
276#endif 337#endif
277} 338}
278 339
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h
index ce45d6a00..7e34c93c1 100644
--- a/users/drashna/rgb_stuff.h
+++ b/users/drashna/rgb_stuff.h
@@ -4,20 +4,29 @@
4# include "rgb_matrix.h" 4# include "rgb_matrix.h"
5#endif 5#endif
6 6
7#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE)
7typedef struct { 8typedef struct {
8 bool enabled; 9 bool enabled;
9 uint8_t hue; 10 uint8_t hue;
10 uint16_t timer; 11 uint16_t timer;
11 uint8_t life; 12 uint8_t life;
12} rgblight_fadeout; 13} rgblight_fadeout;
14#endif
13 15
14bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); 16bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
15void scan_rgblight_fadeout(void);
16void keyboard_post_init_rgb(void); 17void keyboard_post_init_rgb(void);
17void matrix_scan_rgb(void); 18void matrix_scan_rgb(void);
18layer_state_t layer_state_set_rgb(layer_state_t state); 19layer_state_t layer_state_set_rgb(layer_state_t state);
19layer_state_t default_layer_state_set_rgb(layer_state_t state); 20layer_state_t default_layer_state_set_rgb(layer_state_t state);
21
22#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE)
23void scan_rgblight_fadeout(void);
24#endif
25#if defined(RGBLIGHT_ENABLE)
20void rgblight_sethsv_default_helper(uint8_t index); 26void rgblight_sethsv_default_helper(uint8_t index);
21void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); 27#endif
22 28
29#ifdef RGB_MATRIX_ENABLE
30void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
23void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); 31void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type);
32#endif
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index b414036a4..7b77a51d9 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -40,10 +40,6 @@ ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
40endif 40endif
41 41
42 42
43ifeq ($(strip $(MACROS_ENABLED)), yes)
44 OPT_DEFS += -DMACROS_ENABLED
45endif
46
47ifdef CONSOLE_ENABLE 43ifdef CONSOLE_ENABLE
48 ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) 44 ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
49 OPT_DEFS += -DKEYLOGGER_ENABLE 45 OPT_DEFS += -DKEYLOGGER_ENABLE
diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h
index a87247071..d22e2959c 100644
--- a/users/drashna/wrappers.h
+++ b/users/drashna/wrappers.h
@@ -174,11 +174,11 @@ NOTE: These are all the same length. If you do a search/replace
174 174
175 175
176#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG 176#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
177#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM 177#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM
178#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T 178#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
179 179
180#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 180#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
181#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN 181#define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
182#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT 182#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
183 183
184// clang-format on 184// clang-format on