summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJack Humbert2017-11-14 16:11:29 -0500
committerGitHub2017-11-14 16:11:29 -0500
commitec3e065f0d2c65175384699cb11fa388250fa914 (patch)
treee66837d6af1a30b739303bfa06043edf12f9fcc1 /tmk_core
parent3c15c48e6a5c584d225d369ea458f9a3f9cd3d57 (diff)
QMK DFU bootloader generation (#2009)
* 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
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk20
1 files changed, 20 insertions, 0 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 80e8b2be6..94e9a7bdb 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -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
+