mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tools/usb-serial: do not advise people to export PORT.
The example in the tool documentation contains several things that are wrong: - exports PORT. - Defines the port using :=. - Defines PORT instead of PORT_LINUX, PORT_DARWIN - ifeq-based logic (which will force an evaluation). I have not tested the new example script.
This commit is contained in:
parent
c103b3f6ba
commit
7f1357b721
25
dist/tools/usb-serial/README.md
vendored
25
dist/tools/usb-serial/README.md
vendored
@ -41,29 +41,14 @@ solution):
|
||||
# Add serial matching command
|
||||
ifneq ($(PROGRAMMER_SERIAL),)
|
||||
OOCD_BOARD_FLAGS += -c 'ftdi_serial $(PROGRAMMER_SERIAL)'
|
||||
|
||||
ifeq ($(PORT),)
|
||||
# try to find tty name by serial number, only works on Linux currently.
|
||||
ifeq ($(OS),Linux)
|
||||
PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$"))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Fallback PORT if no serial was specified or if the specified serial was not found
|
||||
ifeq ($(PORT),)
|
||||
ifeq ($(OS),Linux)
|
||||
PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh))
|
||||
else ifeq ($(OS),Darwin)
|
||||
PORT := $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
|
||||
endif
|
||||
endif
|
||||
PORT_LINUX_EXACT = $(if $(PROGRAMMER_SERIAL),$(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$")),)
|
||||
|
||||
PORT_LINUX = $(if $(PORT_LINUX_EXACT),$(PORT_LINUX_EXACT),$(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh)))
|
||||
|
||||
PORT_DARWIN = $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
|
||||
|
||||
# TODO: add support for windows as host platform
|
||||
ifeq ($(PORT),)
|
||||
$(info CAUTION: No terminal port for your host system found!)
|
||||
endif
|
||||
export PORT
|
||||
|
||||
|
||||
Limitations
|
||||
|
Loading…
Reference in New Issue
Block a user