diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-01-22 08:23:03 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-22 08:23:03 -0800 |
| commit | 7a08b9d374dfcf9d872738af44b231862064b96f (patch) | |
| tree | a83e16b5b6afd67b22fcbdf81ced5896554ca631 /users/drashna/drashna.c | |
| parent | c16a3dcb5458bc8d237d26c20a434c333b48d5c8 (diff) | |
| download | qmk_firmware-7a08b9d374dfcf9d872738af44b231862064b96f.tar.gz qmk_firmware-7a08b9d374dfcf9d872738af44b231862064b96f.zip | |
[Keymap] Cleanup and updating of drashna keymap code (#11516)
* Update other keyboards for rgb matrix changes
* Remove customized bootmagic code
* Fix corne layout compilation error
* Fix compiler errors with all keymaps
* Add Simple Visualizer for ergodox infinity
* Fix compile issue with Corne
* Fix keymap stuff
* Add alias for mouse layer
* Add Halmak Keyboard layout
* Updates for Kyria
* Add support for oled interval
* Change RGB stuff
[CHANGE] Fix coexistence issues
* Fix rgb_stuff
* Add custom ploopyco mouse keymap
* Decrease default dwell time
* Updates based on last breaking changes update
* Disable command on dactyl
* Update ergodox to use proper commands for rgb matrix indicators
* Update all rgb matrix indicator functions
* Update rules for dactyl-manuform
* Reduce wait time for mouse layer off event
* Add more info to logger
* Add wrappers for get_tapping term
* Move version.h include into only file that actually needs it
* Update rgb sleep stuff
* Update key print function
* Change DM keymap settings
* Change pin for DM Manuform
* Add Proton C stuff for Corne keymap
* more arm corne tinkering
* Even more arm stuff for corne
* Cleanup corne stuff
* redirect default keymap to drashna
because I am a very bad man
* change corne rgb priority
* Update tractyl manuform to not conflict
* Add more secret stuff
* more dactyl tweaks
* Add more options to split transport
* Changes of oled support
* Change split settings
* Improve keylogger formatting more
* tweak oled stuff
* Oled and such tweaks
* Reduce brightness due to leds
* Decrease brightness more
* Only run layer code if master
Diffstat (limited to 'users/drashna/drashna.c')
| -rw-r--r-- | users/drashna/drashna.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index ec6484621..95c9d2f62 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -49,21 +49,6 @@ bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this | |||
| 49 | return false; | 49 | return false; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void bootmagic_lite(void) { | ||
| 53 | matrix_scan(); | ||
| 54 | #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 | ||
| 55 | wait_ms(DEBOUNCING_DELAY * 2); | ||
| 56 | #elif defined(DEBOUNCE) && DEBOUNCE > 0 | ||
| 57 | wait_ms(DEBOUNCE * 2); | ||
| 58 | #else | ||
| 59 | wait_ms(30); | ||
| 60 | #endif | ||
| 61 | matrix_scan(); | ||
| 62 | if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { | ||
| 63 | bootloader_jump(); | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} | 52 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} |
| 68 | 53 | ||
| 69 | void keyboard_pre_init_user(void) { | 54 | void keyboard_pre_init_user(void) { |
| @@ -75,6 +60,7 @@ void keyboard_pre_init_user(void) { | |||
| 75 | // customization of the keymap. Use _keymap instead of _user | 60 | // customization of the keymap. Use _keymap instead of _user |
| 76 | // functions in the keymaps | 61 | // functions in the keymaps |
| 77 | __attribute__((weak)) void matrix_init_keymap(void) {} | 62 | __attribute__((weak)) void matrix_init_keymap(void) {} |
| 63 | __attribute__((weak)) void matrix_init_secret(void) {} | ||
| 78 | 64 | ||
| 79 | // Call user matrix init, set default RGB colors and then | 65 | // Call user matrix init, set default RGB colors and then |
| 80 | // call the keymap's init function | 66 | // call the keymap's init function |
| @@ -86,6 +72,8 @@ void matrix_init_user(void) { | |||
| 86 | DDRB &= ~(1 << 0); | 72 | DDRB &= ~(1 << 0); |
| 87 | PORTB &= ~(1 << 0); | 73 | PORTB &= ~(1 << 0); |
| 88 | #endif | 74 | #endif |
| 75 | |||
| 76 | matrix_init_secret(); | ||
| 89 | matrix_init_keymap(); | 77 | matrix_init_keymap(); |
| 90 | } | 78 | } |
| 91 | 79 | ||
| @@ -103,7 +91,9 @@ void keyboard_post_init_user(void) { | |||
| 103 | 91 | ||
| 104 | __attribute__((weak)) void shutdown_keymap(void) {} | 92 | __attribute__((weak)) void shutdown_keymap(void) {} |
| 105 | 93 | ||
| 94 | #ifdef RGB_MATRIX_ENABLE | ||
| 106 | void rgb_matrix_update_pwm_buffers(void); | 95 | void rgb_matrix_update_pwm_buffers(void); |
| 96 | #endif | ||
| 107 | 97 | ||
| 108 | void shutdown_user(void) { | 98 | void shutdown_user(void) { |
| 109 | #ifdef RGBLIGHT_ENABLE | 99 | #ifdef RGBLIGHT_ENABLE |
| @@ -129,6 +119,8 @@ void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } | |||
| 129 | 119 | ||
| 130 | __attribute__((weak)) void matrix_scan_keymap(void) {} | 120 | __attribute__((weak)) void matrix_scan_keymap(void) {} |
| 131 | 121 | ||
| 122 | __attribute__((weak)) void matrix_scan_secret(void) {} | ||
| 123 | |||
| 132 | // No global matrix scan code, so just run keymap's matrix | 124 | // No global matrix scan code, so just run keymap's matrix |
| 133 | // scan function | 125 | // scan function |
| 134 | void matrix_scan_user(void) { | 126 | void matrix_scan_user(void) { |
| @@ -149,6 +141,8 @@ void matrix_scan_user(void) { | |||
| 149 | matrix_scan_rgb_matrix(); | 141 | matrix_scan_rgb_matrix(); |
| 150 | #endif | 142 | #endif |
| 151 | 143 | ||
| 144 | matrix_scan_secret(); | ||
| 145 | |||
| 152 | matrix_scan_keymap(); | 146 | matrix_scan_keymap(); |
| 153 | } | 147 | } |
| 154 | 148 | ||
| @@ -157,6 +151,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) | |||
| 157 | // on layer change, no matter where the change was initiated | 151 | // on layer change, no matter where the change was initiated |
| 158 | // Then runs keymap's layer change check | 152 | // Then runs keymap's layer change check |
| 159 | layer_state_t layer_state_set_user(layer_state_t state) { | 153 | layer_state_t layer_state_set_user(layer_state_t state) { |
| 154 | if (!is_keyboard_master()) { return state; } | ||
| 155 | |||
| 160 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | 156 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); |
| 161 | #if defined(RGBLIGHT_ENABLE) | 157 | #if defined(RGBLIGHT_ENABLE) |
| 162 | state = layer_state_set_rgb_light(state); | 158 | state = layer_state_set_rgb_light(state); |
| @@ -168,6 +164,8 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t | |||
| 168 | 164 | ||
| 169 | // Runs state check and changes underglow color and animation | 165 | // Runs state check and changes underglow color and animation |
| 170 | layer_state_t default_layer_state_set_user(layer_state_t state) { | 166 | layer_state_t default_layer_state_set_user(layer_state_t state) { |
| 167 | if (!is_keyboard_master()) { return state; } | ||
| 168 | |||
| 171 | state = default_layer_state_set_keymap(state); | 169 | state = default_layer_state_set_keymap(state); |
| 172 | #if 0 | 170 | #if 0 |
| 173 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 171 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
