Switch more of kaleidoscope-builder to use our new preferences loader

pull/815/head
Jesse Vincent 5 years ago
parent 20315ac722
commit 010f4b466c
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -45,17 +45,15 @@ uname_O=$(uname -o 2>/dev/null || echo not)
find_max_prog_size() {
# https://github.com/arduino/arduino-builder/issues/341
PREFS=$(dump_arduino_prefs | grep "upload\.maximum_size=")
MAX_PROG_SIZE=${MAX_PROG_SIZE:-$(echo "${PREFS}" | head -n 1 | cut -d= -f2)}
MAX_PROG_SIZE=${MAX_PROG_SIZE:-$(get_arduino_pref 'upload.maximum_size')}
}
find_device_vid_pid() {
VPIDS=$(dump_arduino_prefs | grep "\.[vp]id=")
VID=${VID:-$(echo "${VPIDS}" | grep build.vid= | cut -dx -f2)}
SKETCH_PID=${SKETCH_PID:-$(echo "${VPIDS}" | grep build.pid= | cut -dx -f2)}
BOOTLOADER_PID=${BOOTLOADER_PID:-$(echo "${VPIDS}" | grep bootloader.pid= | cut -dx -f2)}
BOOTLOADER_VID=${BOOTLOADER_VID:-$(echo "${VPIDS}" | grep bootloader.vid= | cut -dx -f2)}
VID=${VID:-$(get_arduino_pref 'build.vid')}
SKETCH_PID=${SKETCH_PID:-$(get_arduino_pref 'build.pid')}
BOOTLOADER_PID=${BOOTLOADER_PID:-$(get_arduino_pref 'bootloader.pid')}
BOOTLOADER_VID=${BOOTLOADER_VID:-$(get_arduino_pref 'bootloader.vid')}
}
@ -115,8 +113,7 @@ find_bootloader_ports() {
}
find_bootloader_path() {
BOOTLOADER_FILE=$( dump_arduino_prefs | grep "bootloader\.file=" | cut -d= -f2)
BOOTLOADER_FILE=$( get_arduino_pref 'bootloader.file' )
BOOTLOADER_FILE="${BOOTLOADER_FILE:-caterina/Caterina.hex}"
BOOTLOADER_PATH="${BOOTLOADER_PATH:-${BOARD_HARDWARE_PATH}/keyboardio/avr/bootloaders/${BOOTLOADER_FILE}}"
}

Loading…
Cancel
Save