summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-12-14 18:39:54 -0800
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2018-12-14 18:39:54 -0800
commit4f1f52b53ba66ff83ce57e662c27b309ead9c693 (patch)
treea25b2ccf448d85772a178cb57ebc8ad60009fbba /tmk_core
parent91a4a63ac79460c63a8a8d49786ca2a67265b24d (diff)
Add left/right EEPROM flashing for DFU (#4560)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk31
1 files changed, 30 insertions, 1 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index add904c9c5..0c3a9624cb 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -169,6 +169,36 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
fi
$(DFU_PROGRAMMER) $(MCU) reset
+dfu-split-left: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size
+ until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
+ echo "Error: Bootloader not found. Trying again in 5s." ;\
+ sleep 5 ;\
+ done
+ if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\
+ $(DFU_PROGRAMMER) $(MCU) erase --force;\
+ $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\
+ else\
+ $(DFU_PROGRAMMER) $(MCU) erase;\
+ $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\
+ fi
+ $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex
+ $(DFU_PROGRAMMER) $(MCU) reset
+
+dfu-split-right: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size
+ until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
+ echo "Error: Bootloader not found. Trying again in 5s." ;\
+ sleep 5 ;\
+ done
+ if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\
+ $(DFU_PROGRAMMER) $(MCU) erase --force;\
+ $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-righthand.eep;\
+ else\
+ $(DFU_PROGRAMMER) $(MCU) erase;\
+ $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-rightand.eep;\
+ fi
+ $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex
+ $(DFU_PROGRAMMER) $(MCU) reset
+
define EXEC_AVRDUDE
USB= ;\
if $(GREP) -q -s Microsoft /proc/version; then \
@@ -279,4 +309,3 @@ production: $(BUILD_DIR)/$(TARGET).hex bootloader cpfirmware
@cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex
echo "File sizes:"
$(SIZE) $(TARGET).hex $(TARGET)_bootloader.hex $(TARGET)_production.hex
-