]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
QMK DFU bootloader generation (#2009)
authorJack Humbert <jack.humb@gmail.com>
Tue, 14 Nov 2017 21:11:29 +0000 (16:11 -0500)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2017 21:11:29 +0000 (16:11 -0500)
* adds :bootloader target

* update planck and preonic revisions

* remove references to .h files for planck

* update preonic keymap

* only add keyboard.h files that exist

* add production target

* hook things up with the new lufa variables

* update rules for planck/preonic

* back backlight key turn of status led when pressed

* add manufacturer/product strings to bootloader

27 files changed:
build_keyboard.mk
keyboards/planck/config.h
keyboards/planck/keymaps/default/keymap.c
keyboards/planck/planck.h
keyboards/planck/rev3/rev3.c [deleted file]
keyboards/planck/rev3/rev3.h [deleted file]
keyboards/planck/rev4/rev4.c [deleted file]
keyboards/planck/rev4/rev4.h [deleted file]
keyboards/planck/rev5/config.h [new file with mode: 0644]
keyboards/planck/rev5/info.json [new file with mode: 0644]
keyboards/planck/rev5/rules.mk [new file with mode: 0644]
keyboards/planck/rules.mk
keyboards/preonic/config.h
keyboards/preonic/keymaps/default/keymap.c
keyboards/preonic/rev1/config.h [new file with mode: 0644]
keyboards/preonic/rev1/info.json [new file with mode: 0644]
keyboards/preonic/rev1/rules.mk [new file with mode: 0644]
keyboards/preonic/rev2/config.h [new file with mode: 0644]
keyboards/preonic/rev2/info.json [new file with mode: 0644]
keyboards/preonic/rev2/rules.mk [new file with mode: 0644]
keyboards/preonic/rules.mk
lib/lufa/.gitignore
lib/lufa/Bootloaders/DFU/BootloaderDFU.c
lib/lufa/Bootloaders/DFU/Descriptors.c
lib/lufa/Bootloaders/DFU/Descriptors.h
lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h
tmk_core/avr.mk

index 2c86fe55ef0db1c9f2613d2277b69bb1c2bba60e..df025714dbaf595851f745aba20a67befc6ec042 100644 (file)
@@ -94,6 +94,23 @@ endif
 
 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
 
+
+ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
+    QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
+endif
+ifneq ("$(wildcard $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).h)","")
+    QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h
+endif
+ifneq ("$(wildcard $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).h)","")
+    QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h
+endif
+ifneq ("$(wildcard $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).h)","")
+    QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h
+endif
+ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
+    QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
+endif
+
 # We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA
 ifdef MCU_FAMILY
     PLATFORM=CHIBIOS
@@ -233,10 +250,12 @@ ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
     include $(VISUALIZER_PATH)/visualizer.mk
 endif
 
+ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
+
 OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
 $(KEYMAP_OUTPUT)_SRC := $(SRC)
 $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
--DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD_FOLDER_1).h\" -DQMK_KEYBOARD_CONFIG_H=\"$(KEYBOARD_PATH_1)/config.h\" \
+-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" -DQMK_KEYBOARD_CONFIG_H=\"$(KEYBOARD_PATH_1)/config.h\" \
 -DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
 -DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
 $(KEYMAP_OUTPUT)_INC :=  $(VPATH) $(EXTRAINCDIRS)
index bc7ec031ec8dc4dde9115973593e5865d9bea3c1..452a99d7463d5d99ed30b1ac95cdcfe96b693d95 100644 (file)
@@ -24,7 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define VENDOR_ID       0xFEED
 #define PRODUCT_ID      0x6060
 #define MANUFACTURER    OLKB
-#define PRODUCT         The Planck Keyboard
+#define PRODUCT         Planck
 #define DESCRIPTION     A compact ortholinear keyboard
 
 /* key matrix size */
@@ -36,6 +36,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
 #define UNUSED_PINS
 
+#define QMK_ESC_OUTPUT F1
+#define QMK_ESC_INPUT D5
+#define QMK_LED     E6
+#define QMK_SPEAKER C6
+
 #define AUDIO_VOICES
 #define C6_AUDIO
 
index 48b02de38e304f4ec96297cf8d01298500711ceb..87789e1d931ee4e68186003798b34678343413d0 100644 (file)
@@ -224,8 +224,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         #ifdef BACKLIGHT_ENABLE
           backlight_step();
         #endif
+        PORTE &= ~(1<<6);
       } else {
         unregister_code(KC_RSFT);
+        PORTE |= (1<<6);
       }
       return false;
       break;
index 7638b8cc922c10f88c2f6f202facd35a4990a415..6bc6a032091e7a260b8bc923954ce7f8fcbead16 100644 (file)
 #define KEYMAP LAYOUT_planck_grid
 #define LAYOUT_ortho_4x12 LAYOUT_planck_grid
 
-#ifdef KEYBOARD_planck_rev3
-    #include "rev3.h"
-#endif
-#ifdef KEYBOARD_planck_rev4
-    #include "rev4.h"
-#endif
-
 #endif
diff --git a/keyboards/planck/rev3/rev3.c b/keyboards/planck/rev3/rev3.c
deleted file mode 100644 (file)
index 9ccd1d8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "rev3.h"
\ No newline at end of file
diff --git a/keyboards/planck/rev3/rev3.h b/keyboards/planck/rev3/rev3.h
deleted file mode 100644 (file)
index 50a0974..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef REV3_H
-#define REV3_H
-
-#include "planck.h"
-
-#endif
\ No newline at end of file
diff --git a/keyboards/planck/rev4/rev4.c b/keyboards/planck/rev4/rev4.c
deleted file mode 100644 (file)
index 98a75d2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "rev4.h"
\ No newline at end of file
diff --git a/keyboards/planck/rev4/rev4.h b/keyboards/planck/rev4/rev4.h
deleted file mode 100644 (file)
index 74ec054..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef REV4_H
-#define REV4_H
-
-#include "planck.h"
-
-#endif
\ No newline at end of file
diff --git a/keyboards/planck/rev5/config.h b/keyboards/planck/rev5/config.h
new file mode 100644 (file)
index 0000000..696eda7
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef REV5_CONFIG_H
+#define REV5_CONFIG_H
+
+#include "config_common.h"
+
+#define DEVICE_VER 0x0005
+
+#endif
\ No newline at end of file
diff --git a/keyboards/planck/rev5/info.json b/keyboards/planck/rev5/info.json
new file mode 100644 (file)
index 0000000..3d98496
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "identifier": "FEED:6060:0005"
+}
\ No newline at end of file
diff --git a/keyboards/planck/rev5/rules.mk b/keyboards/planck/rev5/rules.mk
new file mode 100644 (file)
index 0000000..3b22e0a
--- /dev/null
@@ -0,0 +1 @@
+AUDIO_ENABLE = yes           # Audio output on port C6
\ No newline at end of file
index 27753cfda8bf6213fd805ad025642cbb010148fc..df575cd6be4c46ecbc406743719bab8a5addcc20 100644 (file)
@@ -69,4 +69,4 @@ SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
 LAYOUTS = ortho_4x12 planck_mit planck_grid
 
-DEFAULT_FOLDER = planck/rev4
+DEFAULT_FOLDER = planck/rev5
index 74db9202d3c980f0596b2a358aab4534bd52a078..172fd645c24d5128fe34d6a8622ae39cbf7e4079 100644 (file)
@@ -23,9 +23,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* USB Device descriptor parameter */
 #define VENDOR_ID       0xFEED
 #define PRODUCT_ID      0x6061
-#define DEVICE_VER      0x0001
 #define MANUFACTURER    OLKB
-#define PRODUCT         The Preonic Keyboard
+#define PRODUCT         Preonic
 #define DESCRIPTION     A compact ortholinear keyboard
 
 /* key matrix size */
@@ -37,6 +36,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
 #define UNUSED_PINS
 
+#define QMK_ESC_OUTPUT F1
+#define QMK_ESC_INPUT B5
+#define QMK_LED     E6
+#define QMK_SPEAKER C6
+
 #define AUDIO_VOICES
 #define C6_AUDIO
 
index 01f40542ca9a9a10c8c327bc680e356d5dd2ec4c..c9d04958a0bb19cb088f59893ce6cd88e2820f50 100644 (file)
@@ -117,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   {KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
   {KC_TILD, KC_EXLM, KC_AT,   KC_HASH, KC_DLR,  KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
   {KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
-  {_______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
+  {_______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______},
   {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
 },
 
@@ -138,7 +138,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC},
   {KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_DEL},
   {KC_DEL,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_MINS, KC_EQL,  KC_LBRC, KC_RBRC, KC_BSLS},
-  {_______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NUHS, KC_NUBS, _______, _______, _______},
+  {_______, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______},
   {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
 },
 
@@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  */
 [_ADJUST] = {
   {KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12},
-  {_______, RESET,   _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
+  {_______, RESET,   DEBUG,   _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL},
   {_______, _______, MU_MOD,  AU_ON,   AU_OFF,  AG_NORM, AG_SWAP, QWERTY,  COLEMAK, DVORAK,  _______, _______},
   {_______, MUV_DE,  MUV_IN,  MU_ON,   MU_OFF,  MI_ON,   MI_OFF,  _______, _______, _______, _______, _______},
   {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
@@ -212,8 +212,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             #ifdef BACKLIGHT_ENABLE
               backlight_step();
             #endif
+            PORTE &= ~(1<<6);
           } else {
             unregister_code(KC_RSFT);
+            PORTE |= (1<<6);
           }
           return false;
           break;
diff --git a/keyboards/preonic/rev1/config.h b/keyboards/preonic/rev1/config.h
new file mode 100644 (file)
index 0000000..56dfedd
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+Copyright 2017 Jack Humbert <jack.humb@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef REV1_CONFIG_H
+#define REV1_CONFIG_H
+
+#include "config_common.h"
+
+#define DEVICE_VER      0x0001
+
+#endif
\ No newline at end of file
diff --git a/keyboards/preonic/rev1/info.json b/keyboards/preonic/rev1/info.json
new file mode 100644 (file)
index 0000000..43a7b49
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "identifier": "FEED:6061:0001"
+}
\ No newline at end of file
diff --git a/keyboards/preonic/rev1/rules.mk b/keyboards/preonic/rev1/rules.mk
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/keyboards/preonic/rev2/config.h b/keyboards/preonic/rev2/config.h
new file mode 100644 (file)
index 0000000..20f1106
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+Copyright 2017 Jack Humbert <jack.humb@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef REV2_CONFIG_H
+#define REV2_CONFIG_H
+
+#include "config_common.h"
+
+#define DEVICE_VER      0x0002
+
+#endif
\ No newline at end of file
diff --git a/keyboards/preonic/rev2/info.json b/keyboards/preonic/rev2/info.json
new file mode 100644 (file)
index 0000000..c8b9b16
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "identifier": "FEED:6061:0002"
+}
\ No newline at end of file
diff --git a/keyboards/preonic/rev2/rules.mk b/keyboards/preonic/rev2/rules.mk
new file mode 100644 (file)
index 0000000..e69de29
index 51104e68baf7e369c853f351bd3e97aed5487664..acef4d97135fc33bf0db2308b4dc9a31b9b69671 100644 (file)
@@ -55,7 +55,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
 BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE = no       # Mouse keys(+4700)
 EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
-CONSOLE_ENABLE = no         # Console for debug(+400)
+CONSOLE_ENABLE = yes         # Console for debug(+400)
 COMMAND_ENABLE = no        # Commands for debug and configuration
 NKRO_ENABLE = no            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
 BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
@@ -69,4 +69,6 @@ API_SYSEX_ENABLE = no
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
-LAYOUTS = ortho_5x12
\ No newline at end of file
+LAYOUTS = ortho_5x12
+
+DEFAULT_FOLDER = preonic/rev2
\ No newline at end of file
index 9f9d39491dd7aedf8150ca3672cff93c9f409d7e..1cd1dccf80b78e3687f44501fcc640275750dd08 100644 (file)
@@ -13,3 +13,4 @@ Documentation/
 LUFA/StudioIntegration/ProjectGenerator/*
 LUFA/StudioIntegration/DocBook/*
 !LUFA/StudioIntegration/Docbook/mshelp/*
+Keyboard.h
\ No newline at end of file
index 928cf6fe3bf5badda23c1c76f61adc5b281fdda2..a2307219ecb678b392c507554b91085c4e6d7014 100644 (file)
@@ -196,7 +196,7 @@ int main(void)
        while (RunBootloader || WaitForExit) {
          USB_USBTask();
          #if (BOARD == BOARD_QMK)
-               bool pressed = (PIN(QMK_ESC_ROW) & NUM(QMK_ESC_ROW));
+               bool pressed = (PIN(QMK_ESC_INPUT) & NUM(QMK_ESC_INPUT));
                if ((DFU_State == dfuIDLE) && (keypress > 5000) && pressed) {
                        break;
                }
@@ -231,12 +231,12 @@ static void SetupHardware(void)
        MCUCR = (1 << IVSEL);
 
        #if (BOARD == BOARD_QMK)
-               // column setup
-               DDR(QMK_ESC_COL) |= NUM(QMK_ESC_COL);
-               PORT(QMK_ESC_COL) |= NUM(QMK_ESC_COL);
+               // output setup
+               DDR(QMK_ESC_OUTPUT) |= NUM(QMK_ESC_OUTPUT);
+               PORT(QMK_ESC_OUTPUT) |= NUM(QMK_ESC_OUTPUT);
 
-               // row setup
-               DDR(QMK_ESC_ROW) |= NUM(QMK_ESC_ROW);
+               // input setup
+               DDR(QMK_ESC_INPUT) |= NUM(QMK_ESC_INPUT);
        #endif
 
        /* Initialize the USB and other board hardware drivers */
@@ -265,7 +265,7 @@ static void ResetHardware(void)
        MCUCR = 0;
 
        #if (BOARD == BOARD_QMK)
-               DDR(QMK_ESC_COL) = PORT(QMK_ESC_COL) = DDR(QMK_ESC_ROW) = PORT(QMK_ESC_ROW) = 0;
+               DDR(QMK_ESC_OUTPUT) = PORT(QMK_ESC_OUTPUT) = DDR(QMK_ESC_INPUT) = PORT(QMK_ESC_INPUT) = 0;
        #endif
 }
 
index 6b7b6d4900a59d0487e43f9530c6e01ded6b8997..46120781b1f462cf58f166fbd0e4a424a100b959 100644 (file)
  */
 
 #include "Descriptors.h"
+#include "Keyboard.h"
+
+#ifndef MANUFACTURER
+    #define MANUFACTURER QMK
+#endif
+#ifndef PRODUCT
+    #define PRODUCT Keyboard
+#endif
 
 /** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall
  *  device characteristics, including the supported USB version, control endpoint size and the
@@ -125,13 +133,13 @@ const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGU
  *  form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  *  Descriptor.
  */
-const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"QMK");
+const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(LSTR(MANUFACTURER));
 
 /** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
  *  and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  *  Descriptor.
  */
-const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"KB");
+const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(LSTR(PRODUCT));
 
 /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
  *  documentation) by the application code so that the address and size of a requested descriptor can be given
index 5487f88f3509efb360f3a97edfe2b29b34500968..7137d0f118a1b41daea0fa63dfbb3893dde1e8a0 100644 (file)
                                                    const uint16_t wIndex,
                                                    const void** const DescriptorAddress)
                                                    ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
-
+               // convert to L string
+               #define LSTR(s) XLSTR(s)
+               #define XLSTR(s) L ## #s
+               // convert to string
+               #define STR(s) XSTR(s)
+               #define XSTR(s) #s
+                                                   
 #endif
 
index 9fc696be976011e7b415cac5d9a3359d3fd71be7..be66b9ed20509a9ba13e1fa6f5c38c31e624ca1b 100644 (file)
@@ -103,10 +103,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
         #define A6 0x06
         #define A7 0x07
 
-        #define QMK_ESC_COL F1
-        #define QMK_ESC_ROW D5
-        #define QMK_LED     E6
-        #define QMK_SPEAKER C6
+        #include "Keyboard.h"
+
+        #ifndef QMK_ESC_INPUT
+            #define QMK_ESC_INPUT F1
+        #endif
+        #ifndef QMK_ESC_OUTPUT
+            #define QMK_ESC_OUTPUT D5
+        #endif
+        #ifndef QMK_LED
+            #define QMK_LED     E6
+        #endif
+        #ifndef QMK_SPEAKER
+            #define QMK_SPEAKER C6
+        #endif
 
         #define DDR(pin) _SFR_IO8(((pin) >> 4) + 1)
         #define PORT(pin) _SFR_IO8(((pin) >> 4) + 2)
index 80e8b2be646f75dc6fdfc23997cb2bb4c6efa64c..94e9a7bdbb06b5907732bf92f55912f4f2daf1d0 100644 (file)
@@ -244,3 +244,23 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf
        @$(SECHO) $(MSG_EXTENDED_COFF) $(BUILD_DIR)/$(TARGET).cof
        $(COFFCONVERT) -O coff-ext-avr $< $(BUILD_DIR)/$(TARGET).cof
 
+bootloader: 
+       make -C lib/lufa/Bootloaders/DFU/ clean
+       echo "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n" > lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "MANUFACTURER" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "PRODUCT" $(ALL_CONFIGS) -h | tail -1` Bootloader >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "QMK_ESC_OUTPUT" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "QMK_ESC_INPUT" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "QMK_LED" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo `grep "QMK_SPEAKER" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       echo "\n#endif" >> lib/lufa/Bootloaders/DFU/Keyboard.h
+       make -C lib/lufa/Bootloaders/DFU/
+       echo "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex"
+       cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex
+
+production: $(BUILD_DIR)/$(TARGET).hex bootloader
+       @cat $(BUILD_DIR)/$(TARGET).hex | awk '/^:00000001FF/ == 0' > $(TARGET)_production.hex
+       @cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex
+       echo "File sizes:"
+       $(SIZE) $(TARGET).hex $(TARGET)_bootloader.hex $(TARGET)_production.hex
+