Updated templates for use by new_project.sh (#3783)
authornoroadsleft <18669334+noroadsleft@users.noreply.github.com>
Wed, 29 Aug 2018 17:57:30 +0000 (10:57 -0700)
committerDrashna Jaelre <drashna@live.com>
Wed, 29 Aug 2018 17:57:30 +0000 (10:57 -0700)
* template.h file cleanup

Reformatted the pre-macro comments as block comments.

Updated the ps2avrgb template comment to match the avr template's comment, which was more informative.

Deleted the line about the macro representing the Planck MIT layout, because the macro doesn't represent that layout anymore.

* base template keymap.c refactor

Deleted the deprecated TMK macro functions.

Defined two custom keycodes for use as macros by process_record_user.

process_record_user is now after the keymap and before matrix_init_user, where the deleted TMK functions were.

* Removed an extra " from macro command per @drashna

* Added BOOTLOADER rule to avr/rules.mk per @drashna

* Updated Bootloader sections per @drashna

* Updated links to docs at the bottom of both avr and ps2avrgb template readme.md files

Corrected the links to the Build Environment Setup and the Make Instructions docs.

Added direct link to the QMK Complete Newbs Guide.

quantum/template/avr/readme.md
quantum/template/avr/rules.mk
quantum/template/avr/template.h
quantum/template/base/keymaps/default/keymap.c
quantum/template/ps2avrgb/readme.md
quantum/template/ps2avrgb/template.h

index d9349811d05097d2d820c9ca2290dc2f234f1efa..d243c66a9489c23cb47ac6d84dcd2fbf3cdf9abf 100644 (file)
@@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment):
 
     make %KEYBOARD%:default
 
-See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
\ No newline at end of file
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
index 92f3a03a921a002fcf387ce6b3b505f8e3f7e3e9..383a3594b4749ba9678e7024c9131c0c73eb0119 100644 (file)
@@ -39,13 +39,24 @@ F_USB = $(F_CPU)
 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
 
 
-# Boot Section Size in *bytes*
-#   Teensy halfKay   512
-#   Teensy++ halfKay 1024
-#   Atmel DFU loader 4096
-#   LUFA bootloader  4096
-#   USBaspLoader     2048
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
+# Bootloader selection
+#   Teensy       halfkay
+#   Pro Micro    caterina
+#   Atmel DFU    atmel-dfu
+#   LUFA DFU     lufa-dfu
+#   QMK DFU      qmk-dfu
+#   atmega32a    bootloadHID
+BOOTLOADER = atmel-dfu
+
+
+# If you don't know the bootloader type, then you can specify the
+# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
+#   Teensy halfKay      512
+#   Teensy++ halfKay    1024
+#   Atmel DFU loader    4096
+#   LUFA bootloader     4096
+#   USBaspLoader        2048
+# OPT_DEFS += -DBOOTLOADER_SIZE=4096
 
 
 # Build Options
index 031efc952910118d327379d2e494fdc828dbea2f..0d626ed50b86d35cc0efac2fee8486525dbb1d58 100644 (file)
 
 #include "quantum.h"
 
-// This a shortcut to help you visually see your layout.
-// The following is an example using the Planck MIT layout
-// The first section contains all of the arguments representing the physical
-// layout of the board and position of the keys
-// The second converts the arguments into a two-dimensional array which 
-// represents the switch matrix. 
+/* This a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
 #define LAYOUT( \
     K00, K01, K02, \
       K10,  K11   \
index 14a8bc0f28c8f3ca565b37558422b9cf05df98dc..5f0730c8a91ddff6916cc9e6e38a5305dc3d3434 100644 (file)
  */
 #include QMK_KEYBOARD_H
 
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = LAYOUT( /* Base */
-  KC_A,  KC_1,  KC_H, \
-    KC_TAB,  KC_SPC   \
-),
+// Defines the keycodes used by our macros in process_record_user
+enum custom_keycodes {
+  QMKBEST = SAFE_RANGE,
+  QMKURL
 };
 
-const uint16_t PROGMEM fn_actions[] = {
-
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  [0] = LAYOUT( /* Base */
+    KC_A,  KC_1,  KC_H, \
+      KC_TAB,  KC_SPC   \
+  ),
 };
 
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
-  // MACRODOWN only works in this function
-      switch(id) {
-        case 0:
-          if (record->event.pressed) {
-            register_code(KC_RSFT);
-          } else {
-            unregister_code(KC_RSFT);
-          }
-        break;
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case QMKBEST:
+      if (record->event.pressed) {
+        // when keycode QMKBEST is pressed
+        SEND_STRING("QMK is the best thing ever!");
+      } else {
+        // when keycode QMKBEST is released
       }
-    return MACRO_NONE;
-};
-
+      break;
+    case QMKURL:
+      if (record->event.pressed) {
+        // when keycode QMKURL is pressed
+        SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
+      } else {
+        // when keycode QMKURL is released
+      }
+      break;
+  }
+  return true;
+}
 
 void matrix_init_user(void) {
 
@@ -50,10 +58,6 @@ void matrix_scan_user(void) {
 
 }
 
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-  return true;
-}
-
 void led_set_user(uint8_t usb_led) {
 
 }
index 1dcbe6e7553159cd43d096222f7bba8106818a62..feec722a521caee4f88e2276968d78c1aba2ed2b 100644 (file)
@@ -41,4 +41,4 @@ macOS:
 4. Place your keyboard into reset. 
 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. 
 
-See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
index c3924ee71f2f37322aadb5e0bb84232289a447c7..b4d6f46624e71684854035ec91416464da089d4e 100644 (file)
 
 #include "quantum.h"
 
-// This a shortcut to help you visually see your layout.
-// The following is an example using the Planck MIT layout
-// The first section contains all of the arguments
-// The second converts the arguments into a two-dimensional array
+/* This a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
 #define LAYOUT( \
     k00, k01, k02, \
       k10,  k11   \