diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-09-07 08:57:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-07 08:57:30 -0700 |
| commit | e88f80a891138d40acddcdd2b3dface8b2a57404 (patch) | |
| tree | 1fa1e8cd0bd15d10970ce55efceaffcddaf01160 /users/drashna/drashna.c | |
| parent | 79a6c6eda50671b28f32dfb73728fcc1671fe4fc (diff) | |
| download | qmk_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/drashna/drashna.c')
| -rw-r--r-- | users/drashna/drashna.c | 37 |
1 files changed, 10 insertions, 27 deletions
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. | ||
| 30 | bool 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 | ||
| 49 | bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { | 30 | bool 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)) | |||
| 123 | void keyboard_post_init_keymap(void) {} | 104 | void keyboard_post_init_keymap(void) {} |
| 124 | 105 | ||
| 125 | void keyboard_post_init_user(void) { | 106 | void 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)) |
| 133 | void shutdown_keymap(void) {} | 114 | void shutdown_keymap(void) {} |
| 134 | 115 | ||
| 116 | void rgb_matrix_update_pwm_buffers(void); | ||
| 117 | |||
| 135 | void shutdown_user(void) { | 118 | void 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 |
| 191 | layer_state_t layer_state_set_user(layer_state_t state) { | 174 | layer_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 | |||
| 203 | layer_state_t default_layer_state_set_user(layer_state_t state) { | 186 | layer_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 |
