diff options
| author | stanrc85 <47038504+stanrc85@users.noreply.github.com> | 2019-03-06 15:20:51 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-03-06 12:20:51 -0800 |
| commit | 33e9f1c75a6961fa25689aba2586fd0ef1fba75f (patch) | |
| tree | 59c653a830ee60fccefd39d09251397edb0eb7de /users/stanrc85/stanrc85.c | |
| parent | be8257f0a784a07e7dd93ecafe96c1d7774383f7 (diff) | |
| download | qmk_firmware-33e9f1c75a6961fa25689aba2586fd0ef1fba75f.tar.gz qmk_firmware-33e9f1c75a6961fa25689aba2586fd0ef1fba75f.zip | |
[Keymap] Add KC_MAKE keycode to my userspace and keymaps (#5324)
* Add keycode for KC_MAKE
* Add KC_MAKE keycode
* Add stanrc85.c file with KC_MAKE
* Remove unused include
* Improved KC_MAKE stolen from Drashna
* Define mod mask for new KC_MAKE code
* RESET board to flash after compiling
* Remove send_string
* RESET fixed in KC_MAKE
Diffstat (limited to 'users/stanrc85/stanrc85.c')
| -rw-r--r-- | users/stanrc85/stanrc85.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c new file mode 100644 index 000000000..ecf364117 --- /dev/null +++ b/users/stanrc85/stanrc85.c | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #include "stanrc85.h" | ||
| 2 | |||
| 3 | __attribute__ ((weak)) | ||
| 4 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 5 | return true; | ||
| 6 | } | ||
| 7 | |||
| 8 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 9 | switch (keycode) { | ||
| 10 | case KC_MAKE: | ||
| 11 | if (!record->event.pressed) { | ||
| 12 | uint8_t temp_mod = get_mods(); | ||
| 13 | uint8_t temp_osm = get_oneshot_mods(); | ||
| 14 | clear_mods(); | ||
| 15 | clear_oneshot_mods(); | ||
| 16 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); | ||
| 17 | if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK ) { | ||
| 18 | //RESET board for flashing if SHIFT held or tapped with KC_MAKE | ||
| 19 | #if defined(__arm__) | ||
| 20 | send_string_with_delay_P(PSTR(":dfu-util"), 10); | ||
| 21 | wait_ms(100); | ||
| 22 | reset_keyboard(); | ||
| 23 | #elif defined(BOOTLOADER_DFU) | ||
| 24 | send_string_with_delay_P(PSTR(":dfu"), 10); | ||
| 25 | #elif defined(BOOTLOADER_HALFKAY) | ||
| 26 | send_string_with_delay_P(PSTR(":teensy"), 10); | ||
| 27 | #elif defined(BOOTLOADER_CATERINA) | ||
| 28 | send_string_with_delay_P(PSTR(":avrdude"), 10); | ||
| 29 | #else | ||
| 30 | reset_keyboard(); | ||
| 31 | #endif // bootloader options | ||
| 32 | } | ||
| 33 | if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } | ||
| 34 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); | ||
| 35 | set_mods(temp_mod); | ||
| 36 | } | ||
| 37 | return false; | ||
| 38 | break; | ||
| 39 | } | ||
| 40 | return process_record_keymap(keycode, record); | ||
| 41 | } | ||
