# -----------------------------------------------------------------------------\r
\r
# Output Messages\r
-MSG_DFU_CMD = ' [DFU] :'\r
+MSG_COPY_CMD = ' [CP] :'\r
+MSG_REMOVE_CMD = ' [RM] :'\r
+MSG_DFU_CMD = ' [DFU] :'\r
\r
# Sanity check the user MCU and TARGET makefile options\r
-ifeq ($(MCU),)\r
- $(error Makefile MCU value not set.)\r
-endif\r
-ifeq ($(TARGET),)\r
- $(error Makefile TARGET value not set.)\r
-endif\r
+MCU ?= $(error Makefile MCU value not set.)\r
+TARGET ?= $(error Makefile TARGET value not set.)\r
\r
flip: $(TARGET).hex\r
@echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"\r
batchisp -hardware usb -device $(MCU) -operation start reset 0\r
\r
flip-ee: $(TARGET).eep\r
+ @echo $(MSG_DFU_CMD) Copying EEP file to temporary file \"$(TARGET)eep.hex\"\r
cp $(TARGET).eep $(TARGET)eep.hex\r
@echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$(TARGET).eep\"\r
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+ @echo $(MSG_DFU_CMD) Removing temporary file \"$(TARGET)eep.hex\"\r
rm $(TARGET)eep.hex\r
\r
dfu: $(TARGET).hex\r