kaleidoscope-builder: Pull the bootloader file from boards.txt

Fixes #697.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/698/head
Gergely Nagy 5 years ago
parent c56941b68c
commit 1672f55945
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -216,6 +216,8 @@ hex_with_bootloader () {
compile compile
fi fi
find_bootloader_path
awk '/^:00000001FF/ == 0' "${HEX_FILE_PATH}" > "${HEX_FILE_WITH_BOOTLOADER_PATH}" awk '/^:00000001FF/ == 0' "${HEX_FILE_PATH}" > "${HEX_FILE_WITH_BOOTLOADER_PATH}"
echo "Using ${BOOTLOADER_PATH}" echo "Using ${BOOTLOADER_PATH}"
${MD5} "${BOOTLOADER_PATH}" ${MD5} "${BOOTLOADER_PATH}"

@ -95,6 +95,20 @@ find_bootloader_ports() {
DEVICE_PORT_BOOTLOADER="$(perl ${DEVICE_PORT_PROBER} ${BOOTLOADER_VID} ${BOOTLOADER_PID})" DEVICE_PORT_BOOTLOADER="$(perl ${DEVICE_PORT_PROBER} ${BOOTLOADER_VID} ${BOOTLOADER_PID})"
} }
find_bootloader_path() {
BOOTLOADER_FILE=$("${ARDUINO_BUILDER}" \
-hardware "${ARDUINO_PATH}/hardware" \
-hardware "${BOARD_HARDWARE_PATH}" \
${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \
-tools "${ARDUINO_PATH}/tools-builder" \
-fqbn "${FQBN}" \
-build-path ${ARDUINO_PATH} \
-dump-prefs "${SKETCH_DIR}/${SKETCH}.ino" | grep "bootloader\.file=" | cut -d= -f2)
BOOTLOADER_FILE="${BOOTLOADER_FILE:-caterina/Caterina.hex}"
BOOTLOADER_PATH="${BOOTLOADER_PATH:-${BOARD_HARDWARE_PATH}/keyboardio/avr/bootloaders/${BOOTLOADER_FILE}}"
}
MD5="md5sum" MD5="md5sum"
if [ "${uname_S}" = "Darwin" ]; then if [ "${uname_S}" = "Darwin" ]; then
@ -188,11 +202,10 @@ AVRDUDE_CONF="${AVRDUDE_CONF:-${ARDUINO_TOOLS_PATH}/avr/etc/avrdude.conf}"
###### ######
BOARD_HARDWARE_PATH="${BOARD_HARDWARE_PATH:-${ARDUINO_LOCAL_LIB_PATH}/hardware}" BOARD_HARDWARE_PATH="${BOARD_HARDWARE_PATH:-${ARDUINO_LOCAL_LIB_PATH}/hardware}"
BOOTLOADER_PATH="${BOOTLOADER_PATH:-${BOARD_HARDWARE_PATH}/keyboardio/avr/bootloaders/caterina/Caterina.hex}"
if [ ! -z "${ARDUINO_TOOLS_PATH}" ]; then if [ ! -z "${ARDUINO_TOOLS_PATH}" ]; then
ARDUINO_TOOLS_PARAM="${ARDUINO_TOOLS_PATH}" ARDUINO_TOOLS_PARAM="${ARDUINO_TOOLS_PATH}"
ARDUINO_TOOLS_FLAG="-tools" ARDUINO_TOOLS_FLAG="-tools"
fi fi
if [ ! -z "${AVR_GCC_PREFIX}" ]; then if [ ! -z "${AVR_GCC_PREFIX}" ]; then

Loading…
Cancel
Save