summaryrefslogtreecommitdiff
path: root/tmk_core/avr.mk
diff options
context:
space:
mode:
authorJosh Colbeck2017-02-21 20:31:16 -0600
committerJosh Colbeck2017-02-21 20:31:16 -0600
commite51001efcc3ff8b64f8264e8bd4c2dbea15f3364 (patch)
treebdf5a0a4b44d5e63ba1376b70d94f64c77f3c90c /tmk_core/avr.mk
parentc56693f858cb3409e4a68a8e65a1370c022a51ed (diff)
parent7ff41df32c29bca4e3a6efc3047b8fa93bb99b92 (diff)
Merge remote-tracking branch 'qmk/master'
Diffstat (limited to 'tmk_core/avr.mk')
-rw-r--r--tmk_core/avr.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 3bf2b34f8..5df539def 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -26,7 +26,7 @@ CFLAGS += -fno-inline-small-functions
CFLAGS += -fno-strict-aliasing
CPPFLAGS += $(COMPILEFLAGS)
-CPPFLAGS += -fno-exceptions
+CPPFLAGS += -fno-exceptions -std=c++11
LDFLAGS +=-Wl,--gc-sections
@@ -107,6 +107,10 @@ flip: $(BUILD_DIR)/$(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter
+ until dfu-programmer $(MCU) get bootloader-version; do\
+ echo "Error: Bootloader not found. Trying again in 5s." ;\
+ sleep 5 ;\
+ done
ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
dfu-programmer $(MCU) erase --force
else
@@ -134,6 +138,11 @@ else
endif
dfu-programmer $(MCU) reset
+# Convert hex to bin.
+flashbin: $(BUILD_DIR)/$(TARGET).hex
+ $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
+ $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;
+ $(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin;
# Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set