mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2026-01-01 01:41:18 +01:00
Merge pull request #18525 from maribu/makefiles/tools/serial.inc.mk
makefiles/tools/serial.inc.mk: Improve PORT selection when RIOT's USB CDC ACM is used for stdio
This commit is contained in:
commit
1d5e5a423d
13
dist/tools/usb-serial/ttys.py
vendored
13
dist/tools/usb-serial/ttys.py
vendored
@ -213,11 +213,14 @@ def print_ttys(args):
|
||||
ttys.append(tty)
|
||||
|
||||
if args.most_recent:
|
||||
most_recent = ttys[0]
|
||||
for tty in ttys:
|
||||
if tty["ctime"] > most_recent["ctime"]:
|
||||
most_recent = tty
|
||||
ttys = [most_recent]
|
||||
if len(ttys) > 0:
|
||||
most_recent = ttys[0]
|
||||
for tty in ttys:
|
||||
if tty["ctime"] > most_recent["ctime"]:
|
||||
most_recent = tty
|
||||
ttys = [most_recent]
|
||||
else:
|
||||
ttys = []
|
||||
|
||||
print_results(args, ttys)
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -86,7 +86,7 @@ extern "C" {
|
||||
* @brief USB peripheral product string
|
||||
*/
|
||||
#ifndef CONFIG_USB_PRODUCT_STR
|
||||
#define CONFIG_USB_PRODUCT_STR "USB device"
|
||||
#define CONFIG_USB_PRODUCT_STR RIOT_BOARD
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@ -62,7 +62,7 @@ config USB_MANUF_STR
|
||||
|
||||
config USB_PRODUCT_STR
|
||||
string "Product string"
|
||||
default "USB device"
|
||||
default BOARD
|
||||
|
||||
config USB_CONFIGURATION_STR
|
||||
string "Configuration string"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user