Update Userspace info to include Bootloader detection
authorDrashna Jael're <drashna@live.com>
Tue, 28 Nov 2017 04:23:42 +0000 (20:23 -0800)
committerJack Humbert <jack.humb@gmail.com>
Tue, 28 Nov 2017 04:36:55 +0000 (23:36 -0500)
docs/feature_userspace.md
users/drashna/template.c

index eaf7aa395afd8b1b0c0020b5f8099ceea2d6d362..98b42b042d73cb5a4629bfc656149fc6091547e0 100644 (file)
@@ -74,6 +74,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
   case KC_MAKE:
     if (!record->event.pressed) {
       SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
+#if  (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
+      SEND_STRING(":dfu");
+#elseif defined(BOOTLOADER_HALFKEY)
+      SEND_STRING(":teensy ");
+#elseif defined(BOOTLOADER_CATERINA)
+      SEND_STRING(":avrdude ");
+#else
+      SEND_STRING(" ");
+#endif
       SEND_STRING(SS_TAP(X_ENTER));
     }
     return false;
@@ -85,3 +94,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 
 This will add a new `KC_MAKE`  keycode that can be used in any of your keymaps.  And this keycode will output `make <keyboard>:<keymap">`, making frequent compiling easier.  And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. 
 
+Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems (AVRDUDE doesn't work on WSL, namely).
+
index f377d64f7a4f64a26f4eba05995187521fe6583c..28f61c04f2f0fc8dc00899b2bda27c84f2971cc5 100644 (file)
@@ -43,8 +43,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
   case KC_MAKE:
     if (!record->event.pressed) {
       SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
-#ifndef BOOTLOADER_CATERINA
+#if  (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
+      SEND_STRING(":dfu");
+#elseif defined(BOOTLOADER_HALFKEY)
       SEND_STRING(":teensy ");
+#elseif defined(BOOTLOADER_CATERINA)
+      SEND_STRING(":avrdude ");
 #else
       SEND_STRING(" ");
 #endif