From 9b9911bdb558a4d43cbecd3a46c379db6610cae5 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 11 Jul 2022 19:46:38 +0200 Subject: [PATCH] etc/makefiles: Call bin/focus-send to do the device reset Instead of simply echoing "device.reset" into the device port, call `bin/focus-send`, which sets the `raw` setting on the port, before writing into it. Without that, the command is not recognised by the firmware. We could do the stty call in the makefile directly, but to support macOS, we'd need to treat that specially, and at that point, it's easier to just call `bin/focus-send`. The sketch relies on having the Kaleidoscope repo available anyway, so we can safely rely on `bin/focus-send` being there, too. Because we're now using the tool in the makefiles, `focus-test` was renamed to `focus-send`. Signed-off-by: Gergely Nagy --- bin/{focus-test => focus-send} | 4 ++-- etc/makefiles/sketch.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename bin/{focus-test => focus-send} (92%) diff --git a/bin/focus-test b/bin/focus-send similarity index 92% rename from bin/focus-test rename to bin/focus-send index c235c154..d300bd84 100755 --- a/bin/focus-test +++ b/bin/focus-send @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# focus-test - Trivial Focus testing tool -# Copyright (C) 2018 Keyboard.io, Inc. +# focus-send - Trivial Focus testing tool +# Copyright (C) 2018-2022 Keyboard.io, Inc. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 286ea89f..2178a739 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -206,8 +206,8 @@ endif $(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) +ifneq ($(_device_port),) + $(QUIET) DEVICE=$(_device_port) $(KALEIDOSCOPE_DIR)/bin/focus-send "device.reset" sleep 2 endif $(QUIET) $(ARDUINO_CLI) upload --fqbn $(FQBN) \