From efd0a526c28340210657cd8ffb4e32895afaac96 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Tue, 21 Jan 2020 10:28:00 +0100 Subject: [PATCH] Enable predefined DEVICE_PORT and DEVICE_PORT_BOOTLOADER Kaleidoscope builder has its own port autodetection. Although fairly robus, this mechanism sometimes fails under certain circumstances on some Linux systems (e.g. Ubuntu 18.04). As a workaround this change enables the variables DEVICE_PORT and DEVICE_PORT_BOOTLOADER being predefined on GNU/Linux, e.g. as DEVICE_PORT=/dev/ttyACM0 make flash which will disable the port autodetection. Signed-off-by: Florian Fleissner mod --- etc/kaleidoscope-builder.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etc/kaleidoscope-builder.conf b/etc/kaleidoscope-builder.conf index 007421d6..d926773d 100644 --- a/etc/kaleidoscope-builder.conf +++ b/etc/kaleidoscope-builder.conf @@ -79,7 +79,11 @@ find_device_port() { find_device_vid_pid DIR=$(dirname "$(readlink -f "$0")") DEVICE_PORT_PROBER="${DIR}/find-device-port-linux-udev" - DEVICE_PORT="$(perl ${DEVICE_PORT_PROBER} ${VID} ${SKETCH_PID})" + if [[ "${DEVICE_PORT}" = "" ]]; then + DEVICE_PORT="$(perl ${DEVICE_PORT_PROBER} ${VID} ${SKETCH_PID})" + else + echo "DEVICE_PORT=\"${DEVICE_PORT}\" predefined." + fi } reset_device_cmd() { @@ -93,7 +97,11 @@ find_bootloader_ports() { DIR=$(dirname "$(readlink -f "$0")") BOOTLOADER_VID="${BOOTLOADER_VID:-${VID}}" DEVICE_PORT_PROBER="${DIR}/find-device-port-linux-udev" - DEVICE_PORT_BOOTLOADER="$(perl ${DEVICE_PORT_PROBER} ${BOOTLOADER_VID} ${BOOTLOADER_PID})" + if [[ "${DEVICE_PORT_BOOTLOADER}" = "" ]]; then + DEVICE_PORT_BOOTLOADER="$(perl ${DEVICE_PORT_PROBER} ${BOOTLOADER_VID} ${BOOTLOADER_PID})" + else + echo "DEVICE_PORT_BOOTLOADER=\"${DEVICE_PORT_BOOTLOADER}\" predefined." + fi } find_bootloader_path() {