From 235e848ea70582e986e1653bb6e2a2bc4244b554 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sat, 3 Jun 2017 21:42:42 +0200 Subject: [PATCH] nrf5/boards/feather52: Add SERIAL makeflag if dfu-flash target is used. --- nrf5/boards/feather52/mpconfigboard.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nrf5/boards/feather52/mpconfigboard.mk b/nrf5/boards/feather52/mpconfigboard.mk index 1b0e1460e9..ce8dcde30d 100644 --- a/nrf5/boards/feather52/mpconfigboard.mk +++ b/nrf5/boards/feather52/mpconfigboard.mk @@ -7,10 +7,19 @@ LD_FILE = boards/feather52/custom_nrf52832_dfu_app.ld NRF_DEFINES += -DNRF52832_XXAA + +check_defined = \ + $(strip $(foreach 1,$1, \ + $(call __check_defined,$1,$(strip $(value 2))))) +__check_defined = \ + $(if $(value $1),, \ + $(error Undefined make flag: $1$(if $2, ($2)))) + .PHONY: dfu-gen dfu-flash dfu-gen: nrfutil dfu genpkg --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip dfu-flash: - sudo nrfutil dfu serial --package $(BUILD)/dfu-package.zip -p /dev/ttyACM3 + @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) + sudo nrfutil dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL)