|
|
|
@ -20,15 +20,6 @@ set -e
|
|
|
|
|
######
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_configure_arduino_cli() {
|
|
|
|
|
if [ -z "${ARDUINO_CLI}" ]; then
|
|
|
|
|
cmd_install_arduino_cli
|
|
|
|
|
fi
|
|
|
|
|
if [ -z "${ARDUINO_CLI_CONFIG}" ]; then
|
|
|
|
|
_run_arduino_cli config init
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_run_arduino_cli() {
|
|
|
|
|
"${ARDUINO_CLI}" "$@"
|
|
|
|
|
}
|
|
|
|
@ -59,7 +50,6 @@ _find_sketch() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_flash() {
|
|
|
|
|
_set_up_environment
|
|
|
|
|
#TODO (arduino team) I'd love to do this with their json output
|
|
|
|
|
#but it's short some of the data we kind of need
|
|
|
|
|
port=$(_run_arduino_cli board list --format=text | grep "$FQBN" |cut -d' ' -f 1)
|
|
|
|
@ -78,27 +68,7 @@ cmd_flash() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_hex_with_bootloader() {
|
|
|
|
|
_set_up_environment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
awk '/^:00000001FF/ == 0' "${HEX_FILE_PATH}" >"${HEX_FILE_WITH_BOOTLOADER_PATH}"
|
|
|
|
|
echo "Using ${BOOTLOADER_PATH}"
|
|
|
|
|
cat "${BOOTLOADER_PATH}" >>"${HEX_FILE_WITH_BOOTLOADER_PATH}"
|
|
|
|
|
ln -sf -- "${OUTPUT_FILE_PREFIX}-with-bootloader.hex" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest-with-bootloader.hex"
|
|
|
|
|
cat <<-EOF
|
|
|
|
|
|
|
|
|
|
Combined firmware and bootloader are now at ${HEX_FILE_WITH_BOOTLOADER_PATH}
|
|
|
|
|
Make sure you have the bootloader version you expect.
|
|
|
|
|
|
|
|
|
|
And TEST THIS ON REAL HARDWARE BEFORE YOU GIVE IT TO ANYONE
|
|
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cmd_compile() {
|
|
|
|
|
_set_up_environment
|
|
|
|
|
|
|
|
|
|
install -d "${OUTPUT_PATH}"
|
|
|
|
|
|
|
|
|
|
echo "Building ${SKETCH_FILE_PATH}"
|
|
|
|
@ -133,11 +103,6 @@ cmd_compile() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_set_up_environment() {
|
|
|
|
|
_find_sketch
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_help() {
|
|
|
|
|
cat <<-EOF
|
|
|
|
|
Usage: $0 SKETCH commands...
|
|
|
|
|