2021-08-16 04:55:23 +08:00
|
|
|
# Hey Emacs, this is a -*- makefile -*-
|
|
|
|
##############################################################################
|
|
|
|
# Architecture or project specific options
|
|
|
|
#
|
|
|
|
|
2021-10-16 05:07:33 +08:00
|
|
|
MDLOADER_CLI ?= mdloader
|
|
|
|
|
|
|
|
define EXEC_MDLOADER
|
|
|
|
$(MDLOADER_CLI) --first --download $(BUILD_DIR)/$(TARGET).bin --restart
|
|
|
|
endef
|
|
|
|
|
|
|
|
mdloader: bin
|
|
|
|
$(call EXEC_MDLOADER)
|
|
|
|
|
2021-08-16 04:55:23 +08:00
|
|
|
flash: bin
|
2022-10-03 09:26:04 +08:00
|
|
|
$(SILENT) || printf "Flashing for bootloader: $(BLUE)$(BOOTLOADER)$(NO_COLOR)\n"
|
2021-08-16 04:55:23 +08:00
|
|
|
ifneq ($(strip $(PROGRAM_CMD)),)
|
2021-08-18 06:46:59 +08:00
|
|
|
$(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD)
|
2021-10-16 05:07:33 +08:00
|
|
|
else ifeq ($(strip $(ARM_ATSAM)),SAMD51J18A)
|
|
|
|
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_MDLOADER)
|
2021-08-16 04:55:23 +08:00
|
|
|
else
|
|
|
|
$(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_ARCH)"
|
|
|
|
endif
|