#!/bin/bash # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2012-2024 Scott Penrose and WII5 Buoy contributors # # This file is part of WII5 Buoy firmware. # See LICENSE for full terms. # Verify the WII5 sketch with the local Arduino IDE, then rsync the resulting # .hex to a remote build host. # Usage: upload.sh # - the remote-side ssh user is taken from $WII5_REMOTE_USER (default: wii) # - the local Arduino build dir is ~/Arduino/build by default; override with # $WII5_BUILD_DIR. : "${WII5_REMOTE_USER:=wii}" : "${WII5_BUILD_DIR:=$HOME/Arduino/build}" : "${WII5_ARDUINO_BIN:=arduino}" set -e REMOTE=$1 [ -z "$REMOTE" ] && { echo "Usage: $0 "; exit 1; } rm -f "$WII5_BUILD_DIR/wii5_buoy.ino.hex" "$WII5_ARDUINO_BIN" --verify app/wii5_buoy/wii5_buoy.ino \ --board WII:5.1.0:wii5_v2_2560_3V:cpu=atmega25603V3_11MHz230400 -v rsync -av "$WII5_BUILD_DIR/wii5_buoy.ino.hex" "$WII5_REMOTE_USER@$REMOTE:~/"