1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-16 02:12:53 +01:00
RIOT/makefiles/tools/serial.inc.mk
Juan Carrano fe9704dbd6 makefiles/tools/serial: ensure PORT is set and fail early.
By ensuring the PORT auto-detection worked, we can give meaningful
error messages and fail earlier.

This uses ensure_value from makefiles/utils/checks.mk. An include was
added to Makefile.include to make this fuction available to all other
makefiles.
2019-10-17 08:54:16 +02:00

23 lines
693 B
Makefile

# set default port depending on operating system
OS := $(shell uname)
ifeq ($(OS),Linux)
PORT ?= $(call ensure_value,$(PORT_LINUX),No port set)
else ifeq ($(OS),Darwin)
PORT ?= $(call ensure_value,$(PORT_DARWIN),No port set)
endif
export BAUD ?= 115200
RIOT_TERMINAL ?= pyterm
ifeq ($(RIOT_TERMINAL),pyterm)
TERMPROG ?= $(RIOTTOOLS)/pyterm/pyterm
TERMFLAGS ?= -p "$(PORT)" -b "$(BAUD)" $(PYTERMFLAGS)
else ifeq ($(RIOT_TERMINAL),socat)
SOCAT_OUTPUT ?= -
TERMPROG ?= $(RIOT_TERMINAL)
TERMFLAGS ?= $(SOCAT_OUTPUT) open:$(PORT),b$(BAUD),echo=0,raw
else ifeq ($(RIOT_TERMINAL),picocom)
TERMPROG ?= picocom
TERMFLAGS ?= --nolock --imap lfcrlf --baud "$(BAUD)" "$(PORT)"
endif