From 78de9a3f53ca07723586e5445ad0e7e8dbee669a Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 29 Aug 2022 16:39:25 +0200 Subject: [PATCH] makefiles/tools/serial.inc.mk: Improve PORT selection When `stdio_cdc_acm` is used, assume `"RIOT-os\.org"` as vendor string and `$(BOARD)` being used as model string. This is the default behavior in RIOT since eaace28804effe222b4cfbdbb19dbf621f00ed84 --- makefiles/tools/serial.inc.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefiles/tools/serial.inc.mk b/makefiles/tools/serial.inc.mk index 975b54681f..2b9bc86401 100644 --- a/makefiles/tools/serial.inc.mk +++ b/makefiles/tools/serial.inc.mk @@ -1,7 +1,11 @@ # Select the most recently attached tty interface ifeq (1,$(MOST_RECENT_PORT)) + ifneq (,$(filter stdio_cdc_acm,$(USEMODULE))) + TTY_BOARD_FILTER ?= --model $(BOARD) --vendor 'RIOT-os\.org' + endif TTYS_FLAGS := --most-recent --format path $(TTY_BOARD_FILTER) - PORT ?= $(shell $(RIOTTOOLS)/usb-serial/ttys.py $(TTYS_FLAGS)) + PORT_DETECTED := $(shell $(RIOTTOOLS)/usb-serial/ttys.py $(TTYS_FLAGS)) + PORT ?= $(PORT_DETECTED) endif # Otherwise, use as default the most commonly used ports on Linux and OSX PORT_LINUX ?= /dev/ttyACM0