1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 05:53:49 +01:00

Merge pull request #14431 from aabadie/pr/makefile/sam0_serial_no_flash

makefiles/sam0: only fail on missing device with explicit targets
This commit is contained in:
Alexandre Abadie 2020-07-03 11:42:37 +02:00 committed by GitHub
commit 774e2bbab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,15 +5,17 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# DEBUG_ADAPTER_ID="ATML..."
# The SERIAL setting is only available for backwards compatibility with older
# settings.
ifneq (,$(SERIAL))
EDBG_ARGS += --serial $(SERIAL)
SERIAL_TTY = $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh $(SERIAL)))
ifeq (,$(SERIAL_TTY))
$(error Did not find a device with serial $(SERIAL))
# settings. It's only checked when a target is given to the make command.
ifneq (,$(filter debug% flash% %term test,$(MAKECMDGOALS)))
ifneq (,$(SERIAL))
EDBG_ARGS += --serial $(SERIAL)
SERIAL_TTY = $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh $(SERIAL)))
ifeq (,$(SERIAL_TTY))
$(error Did not find a device with serial $(SERIAL))
endif
PORT_LINUX := $(SERIAL_TTY)
DEBUG_ADAPTER_ID ?= $(SERIAL)
endif
PORT_LINUX := $(SERIAL_TTY)
DEBUG_ADAPTER_ID ?= $(SERIAL)
endif
# setup serial terminal