From 1031da354f0f02430c33a64b0c3f75969909ef09 Mon Sep 17 00:00:00 2001 From: Antonio Galea Date: Sun, 23 Aug 2020 02:35:15 +0200 Subject: [PATCH] boards/yarm: delay terminal connection after flashing --- boards/yarm/Makefile.include | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/boards/yarm/Makefile.include b/boards/yarm/Makefile.include index 0c4862de71..1db4363d1f 100644 --- a/boards/yarm/Makefile.include +++ b/boards/yarm/Makefile.include @@ -1 +1,16 @@ include $(RIOTMAKE)/boards/sam0.inc.mk + +TERMDELAYDEPS := $(filter reset flash flash-only, $(MAKECMDGOALS)) +ifneq (,$(TERMDELAYDEPS)) + # By default, add 2 seconds delay before opening terminal: this is required + # when opening the terminal right after flashing. In this case, the stdio + # over USB needs some time after reset before being ready. + TERM_DELAY ?= 2 + TERMDEPS += term-delay +endif + +TESTRUNNER_CONNECT_DELAY ?= $(TERM_DELAY) +$(call target-export-variables,test,TESTRUNNER_CONNECT_DELAY) + +term-delay: $(TERMDELAYDEPS) + sleep $(TERM_DELAY)