From ee1e2af232218f0615b905defe5d657b3d1e9e01 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:34:15 +0200 Subject: [PATCH] makefiles: add shared sam0 board makefile include --- makefiles/boards/sam0.inc.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 makefiles/boards/sam0.inc.mk diff --git a/makefiles/boards/sam0.inc.mk b/makefiles/boards/sam0.inc.mk new file mode 100644 index 0000000000..89a76ea42c --- /dev/null +++ b/makefiles/boards/sam0.inc.mk @@ -0,0 +1,21 @@ +# set default port depending on operating system +PORT_LINUX ?= /dev/ttyACM0 +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) + +# setup serial terminal +include $(RIOTMAKE)/tools/serial.inc.mk + +# Add board selector (USB serial) to OpenOCD options if specified. +# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. +# Usage: SERIAL="ATML..." BOARD= make flash +ifneq (,$(SERIAL)) + export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" + SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) + ifeq (,$(SERIAL_TTY)) + $(error Did not find a device with serial $(SERIAL)) + endif + PORT_LINUX := $(SERIAL_TTY) +endif + +# this board uses openocd +include $(RIOTMAKE)/tools/openocd.inc.mk