Add a new MANUAL_RESET feature to Kaleidoscope builder

Some devices, like those coming from QMK don't have an automated reset
feature

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/841/head
Jason Koh 5 years ago committed by Jesse Vincent
parent 14a85fb864
commit 476cbe1785

@ -173,9 +173,16 @@ flash () {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
${preFlash_HOOKS} ${preFlash_HOOKS}
# If we're -not- doing a manual reset, then try to do it automatically
if [ -z "${MANUAL_RESET}" ]; then
reset_device reset_device
sleep 2 sleep 2
find_bootloader_ports find_bootloader_ports
# Otherwise, poll for a bootloader port.
else
wait_for_bootloader_port
fi
fi fi
check_bootloader_port_and_flash check_bootloader_port_and_flash
@ -185,6 +192,25 @@ flash () {
${postFlash_HOOKS} ${postFlash_HOOKS}
} }
wait_for_bootloader_port() {
declare -i tries
tries=15
while [ "$tries" -gt 0 ] && [ -z "${DEVICE_PORT_BOOTLOADER}" ]; do
sleep 1
printf "."
find_bootloader_ports
# the variable annotations do appear to be necessary
# shellcheck disable=SC2004
tries=$(($tries-1))
done
if [ "$tries" -gt 0 ]; then
echo "Found."
else
echo "Timed out."
fi
}
check_bootloader_port () { check_bootloader_port () {
if [ -z "${DEVICE_PORT_BOOTLOADER}" ]; then if [ -z "${DEVICE_PORT_BOOTLOADER}" ]; then

Loading…
Cancel
Save