diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-10-15 12:34:49 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-10-15 15:34:49 -0400 |
| commit | 31d12662bde435e6636347ee842108b1cb3d8d48 (patch) | |
| tree | 05f6191b49aeadea2321966e810f160f4dec5af2 /users/drashna/drashna.c | |
| parent | 44a348d56f661d22144202f440b87c26832a8170 (diff) | |
| download | qmk_firmware-31d12662bde435e6636347ee842108b1cb3d8d48.tar.gz qmk_firmware-31d12662bde435e6636347ee842108b1cb3d8d48.zip | |
Update to drashna keymaps and userspace - RGB edition (#4143)
* Fix up userspace after feature merges
* Add new macros for keyboard layouts
* Keep new layouts in keymap for easy reference
* Cleanup layouts
* Fix CRKBD wrappers
* Fix up comments
* Fix spacing in orthodox base layer
* ergodox related cleanup
* Make KC_MAKE only flash when holding shift
* Add option to fast compile boards
* Clean up rgb modes to save space
* Re-enable Swap Hands on my Iris
Diffstat (limited to 'users/drashna/drashna.c')
| -rw-r--r-- | users/drashna/drashna.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index aad9fab61..5b6620cf3 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -36,11 +36,11 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { | |||
| 36 | keycode = KC_ENTER; | 36 | keycode = KC_ENTER; |
| 37 | } | 37 | } |
| 38 | clear_keyboard(); | 38 | clear_keyboard(); |
| 39 | tap(keycode); | 39 | tap_code(keycode); |
| 40 | wait_ms(50); | 40 | wait_ms(50); |
| 41 | send_string_with_delay(str, MACRO_TIMER); | 41 | send_string_with_delay(str, MACRO_TIMER); |
| 42 | wait_ms(50); | 42 | wait_ms(50); |
| 43 | tap(KC_ENTER); | 43 | tap_code(KC_ENTER); |
| 44 | } | 44 | } |
| 45 | if (override) wait_ms(3000); | 45 | if (override) wait_ms(3000); |
| 46 | return false; | 46 | return false; |
| @@ -127,13 +127,13 @@ uint32_t default_layer_state_set_keymap (uint32_t state) { | |||
| 127 | __attribute__ ((weak)) | 127 | __attribute__ ((weak)) |
| 128 | void led_set_keymap(uint8_t usb_led) {} | 128 | void led_set_keymap(uint8_t usb_led) {} |
| 129 | 129 | ||
| 130 | 130 | __attribute__ ((weak)) | |
| 131 | void eeconfig_init_keymap(void) {} | ||
| 131 | 132 | ||
| 132 | // Call user matrix init, set default RGB colors and then | 133 | // Call user matrix init, set default RGB colors and then |
| 133 | // call the keymap's init function | 134 | // call the keymap's init function |
| 134 | void matrix_init_user(void) { | 135 | void matrix_init_user(void) { |
| 135 | userspace_config.raw = eeprom_read_dword(EECONFIG_USERSPACE); | 136 | userspace_config.raw = eeconfig_read_user(); |
| 136 | |||
| 137 | 137 | ||
| 138 | #ifdef BOOTLOADER_CATERINA | 138 | #ifdef BOOTLOADER_CATERINA |
| 139 | DDRD &= ~(1<<5); | 139 | DDRD &= ~(1<<5); |
| @@ -250,7 +250,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 250 | 250 | ||
| 251 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader | 251 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader |
| 252 | if (!record->event.pressed) { | 252 | if (!record->event.pressed) { |
| 253 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP | 253 | uint8_t temp_mod = get_mods(); |
| 254 | clear_mods(); | ||
| 255 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); | ||
| 256 | if (temp_mod & MODS_SHIFT_MASK) { | ||
| 257 | send_string_with_delay_P(PSTR( | ||
| 254 | #if defined(__ARM__) | 258 | #if defined(__ARM__) |
| 255 | ":dfu-util" | 259 | ":dfu-util" |
| 256 | #elif defined(BOOTLOADER_DFU) | 260 | #elif defined(BOOTLOADER_DFU) |
| @@ -260,7 +264,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 260 | #elif defined(BOOTLOADER_CATERINA) | 264 | #elif defined(BOOTLOADER_CATERINA) |
| 261 | ":avrdude" | 265 | ":avrdude" |
| 262 | #endif // bootloader options | 266 | #endif // bootloader options |
| 263 | SS_TAP(X_ENTER)), 10); | 267 | ), 10); |
| 268 | } | ||
| 269 | if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } | ||
| 270 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); | ||
| 271 | set_mods(temp_mod); | ||
| 264 | } | 272 | } |
| 265 | return false; | 273 | return false; |
| 266 | break; | 274 | break; |
| @@ -268,8 +276,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 268 | case EPRM: // Resets EEPROM | 276 | case EPRM: // Resets EEPROM |
| 269 | if (record->event.pressed) { | 277 | if (record->event.pressed) { |
| 270 | eeconfig_init(); | 278 | eeconfig_init(); |
| 271 | default_layer_set(1UL<<eeconfig_read_default_layer()); | ||
| 272 | layer_state_set(layer_state); | ||
| 273 | } | 279 | } |
| 274 | return false; | 280 | return false; |
| 275 | break; | 281 | break; |
| @@ -295,7 +301,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 295 | // to save on firmware space, since it's limited. | 301 | // to save on firmware space, since it's limited. |
| 296 | #ifdef MACROS_ENABLED | 302 | #ifdef MACROS_ENABLED |
| 297 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros | 303 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros |
| 298 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); } | 304 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } |
| 299 | #ifdef RGBLIGHT_ENABLE | 305 | #ifdef RGBLIGHT_ENABLE |
| 300 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); | 306 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); |
| 301 | #endif //RGBLIGHT_ENABLE | 307 | #endif //RGBLIGHT_ENABLE |
| @@ -344,11 +350,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 344 | } else { | 350 | } else { |
| 345 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy | 351 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy |
| 346 | register_code(KC_LCTL); | 352 | register_code(KC_LCTL); |
| 347 | tap(KC_C); | 353 | tap_code(KC_C); |
| 348 | unregister_code(KC_LCTL); | 354 | unregister_code(KC_LCTL); |
| 349 | } else { // Tap, paste | 355 | } else { // Tap, paste |
| 350 | register_code(KC_LCTL); | 356 | register_code(KC_LCTL); |
| 351 | tap(KC_V); | 357 | tap_code(KC_V); |
| 352 | unregister_code(KC_LCTL); | 358 | unregister_code(KC_LCTL); |
| 353 | } | 359 | } |
| 354 | } | 360 | } |
| @@ -413,3 +419,8 @@ uint32_t default_layer_state_set_user(uint32_t state) { | |||
| 413 | void led_set_user(uint8_t usb_led) { | 419 | void led_set_user(uint8_t usb_led) { |
| 414 | led_set_keymap(usb_led); | 420 | led_set_keymap(usb_led); |
| 415 | } | 421 | } |
| 422 | |||
| 423 | void eeconfig_init_user(void) { | ||
| 424 | userspace_config.raw = 0; | ||
| 425 | eeconfig_update_user(userspace_config.raw); | ||
| 426 | } | ||
