diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 472684e7..24a4eb2b 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -147,11 +147,16 @@ prepare_to_flash () { compile size fi + + flashing_instructions=$(get_arduino_pref 'build.flashing_instructions') - echo "To update your keyboard's firmware, hold down the 'Prog' key on your keyboard," - echo "and then press 'Enter'." + if [ "x${flashing_instructions}x" == "xx" ]; then + flashing_instructions="If your keyboard needs you to do something to put it in flashing mode, do that now." + fi + + printf '%b\n\n' "${flashing_instructions}" echo "" - echo "When the 'Prog' key glows red, you can release it." + echo "When you're ready proceed, press 'Enter'." echo "" # We do not want to permit line continuations here. We just want a newline. diff --git a/etc/kaleidoscope-builder.conf b/etc/kaleidoscope-builder.conf index 0e42c950..acb0516d 100644 --- a/etc/kaleidoscope-builder.conf +++ b/etc/kaleidoscope-builder.conf @@ -59,6 +59,14 @@ find_device_vid_pid() { } +get_arduino_pref() { + pref=$1 + # Strip the preference name. And then strip leading and trailing quotations + MESSAGE=$(dump_arduino_prefs | grep ${pref}= | sed -e s/^${pref}=// -e 's/^"//' -e 's/"$//') + echo $MESSAGE +} + + dump_arduino_prefs() { # SKETCH and -build-path in this command are here because of a bug introduced in Arduino 1.8.10 # https://github.com/arduino/arduino-builder/issues/341