summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorzvecr <git@zvecr.com>2019-05-31 00:53:49 +0100
committerDrashna Jaelre <drashna@live.com>2019-05-30 16:53:49 -0700
commit2f7a57a6de1af48262702eabad39c2563c02f253 (patch)
tree3d8dc212f0cb9294a1e340665809b5cf9849d78a /tmk_core
parent786ee9c7bef3852aa107c98c3a0edd0d0c7fe9bc (diff)
Copy avr teensy flash logic to arm (#6016)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 44c00bdd15..11715cf346 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -260,6 +260,19 @@ dfu-util-wait: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
$(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
+
+# Autodetect teensy loader
+ifndef TEENSY_LOADER_CLI
+ ifneq (, $(shell which teensy-loader-cli 2>/dev/null))
+ TEENSY_LOADER_CLI ?= teensy-loader-cli
+ else
+ TEENSY_LOADER_CLI ?= teensy_loader_cli
+ endif
+endif
+
+teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter
+ $(TEENSY_LOADER_CLI) -mmcu=$(MCU_LDSCRIPT) -w -v $(BUILD_DIR)/$(TARGET).hex
+
bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \
$(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\