From 7ea8753b72ed7ddecdcb2db5b223ca920f8155b3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 10 Jul 2017 13:46:39 +0300 Subject: Don't run dfu-programmer unless specified as a target This introduces a grep dependency, which I believe we didn't have before, but it should be available and installed by default on all the supported systems. --- tmk_core/avr.mk | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index ccecdb1929..a36d219dd0 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -115,11 +115,11 @@ dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter 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 - $(DFU_PROGRAMMER) $(MCU) erase -endif + if $(DFU_PROGRAMMER) --version 2>&1 | grep -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) erase --force;\ + else\ + $(DFU_PROGRAMMER) $(MCU) erase;\ + fi $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex $(DFU_PROGRAMMER) $(MCU) reset @@ -135,11 +135,11 @@ flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep $(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep -ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) - $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep -else - $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep -endif + if $(DFU_PROGRAMMER) --version 2>&1 | grep -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep;\ + else\ + $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep;\ + fi $(DFU_PROGRAMMER) $(MCU) reset # Convert hex to bin. -- cgit v1.2.3 From ba405cfbb4b887af8007edfeed4d9fc43766d911 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 10 Jul 2017 13:50:07 +0300 Subject: Don't search for TEENSY_LOADER_CLI if it's already defined --- tmk_core/avr.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index a36d219dd0..6773726ee3 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -87,11 +87,13 @@ DEBUG_PORT = 4242 DEBUG_HOST = localhost #============================================================================ -# Autodecct teensy loader -ifneq (, $(shell which teensy-loader-cli 2>/dev/null)) - TEENSY_LOADER_CLI ?= teensy-loader-cli -else - TEENSY_LOADER_CLI ?= teensy_loader_cli +# 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 # Program the device. -- cgit v1.2.3 From 42d5a324eb673b2214a87c8911d850105c3bdaab Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 10 Jul 2017 11:18:47 -0400 Subject: Start mvoing hardware drivers to /drivers/ (#1433) * start driver isolation * update nyquist and orthodox boards * update atreus62 * move drivers to avr * update avr conditional --- tmk_core/avr.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 6773726ee3..4af34ba574 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -12,7 +12,7 @@ HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) BIN = - +COMMON_VPATH += $(DRIVER_PATH)/avr COMPILEFLAGS += -funsigned-char COMPILEFLAGS += -funsigned-bitfields -- cgit v1.2.3