From 21a67ae565262bb995b22960ce4542c9b6d86d28 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 25 May 2022 12:39:08 -0700 Subject: [PATCH] A couple of quick correctness fixes to our port detection logic for device reboot --- etc/makefiles/sketch.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 45feb4ce..98b01b42 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -193,7 +193,7 @@ endif flashing_instructions = $(call _arduino_prop,build.flashing_instructions) -_device_port = $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1 | xargs -n 1) +_device_port = $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1) flash: ${HEX_FILE_PATH} ifneq ($(flashing_instructions),) @@ -205,7 +205,10 @@ endif $(info When you're ready to proceed, press 'Enter'.) $(info ) @$(shell read _) +# If we have a device serial port available, try to trigger a Kaliedoscope reset +ifneq ($(_device_port),) $(QUIET) echo "device.reset" > $(_device_port) +endif $(QUIET) $(ARDUINO_CLI) upload --fqbn $(FQBN) \ $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1 | xargs -n 1 echo "--port" ) \ --input-dir "${OUTPUT_PATH}" \