From 93ce9450d1579069356d0a71322dd7dca1b1c134 Mon Sep 17 00:00:00 2001 From: Noe Xu Date: Tue, 8 Feb 2022 17:16:12 +0800 Subject: [PATCH] Use a variable named DFU_PROG to identify dfu-programmer. And it's convenient for using `make dfu-prog' under WSL. --- Firmware/Chameleon-Mini/Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Firmware/Chameleon-Mini/Makefile b/Firmware/Chameleon-Mini/Makefile index 91903503..6c864e8a 100644 --- a/Firmware/Chameleon-Mini/Makefile +++ b/Firmware/Chameleon-Mini/Makefile @@ -135,6 +135,13 @@ AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) AVRDUDE_WRITE_APP_LATEST = -U application:w:Latest/Chameleon-RevG.hex AVRDUDE_WRITE_EEPROM_LATEST = -U eeprom:w:Latest/Chameleon-RevG.eep +WSLENV ?= notwsl +ifndef WSLENV +DFU_PROG = ./dfu-programmer.exe +else +DFU_PROG = dfu-programmer +endif + .PHONY: program program-latest dfu-flip dfu-prog dfu-reset check_size style # Default target @@ -183,10 +190,10 @@ dfu-flip: $(TARGET).hex $(TARGET).eep check_size # Program the device using dfu-programmer dfu-prog: $(TARGET).hex $(TARGET).eep check_size - dfu-programmer $(MCU) erase - dfu-programmer $(MCU) flash-eeprom $(TARGET).eep - dfu-programmer $(MCU) flash $(TARGET).hex - dfu-programmer $(MCU) reset + $(DFU_PROG) $(MCU) erase + $(DFU_PROG) $(MCU) flash-eeprom $(TARGET).eep + $(DFU_PROG) $(MCU) flash $(TARGET).hex + $(DFU_PROG) $(MCU) reset # Reset the device after firmware upgrade dfu-reset: