Initial public release of WII5 Buoy firmware
Firmware for an autonomous wave-measurement buoy (ATmega2560-based WII5 v2 board). Reads wave motion from a Sparton AHRS-M1/M2 IMU, samples GPS and battery state, and reports back over Iridium SBD satellite telemetry. Originally developed 2012-2024. This is the first public release. Code, documentation, and field-tested operating modes (Capture, Sleep, Position, ManualTest, SelfTest, LowBattery) are licensed under Apache 2.0 — see LICENSE and NOTICE. See README.md for an overview and build instructions, CONTRIBUTING.md for how to contribute, and DEPLOYMENTS.md for the field-deployment log.
This commit is contained in:
Executable
+67
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2012-2024 Scott Penrose <scottp@dd.com.au> and WII5 Buoy contributors
|
||||
#
|
||||
# This file is part of WII5 Buoy firmware.
|
||||
# See LICENSE for full terms.
|
||||
|
||||
# Build a versioned firmware hex and (optionally) commit it into a separate
|
||||
# firmware-archive repo.
|
||||
#
|
||||
# Usage: build_version.sh [VERSION_TAG]
|
||||
# - With VERSION_TAG: checks out that tag, builds, names the hex
|
||||
# wii5_buoy_<VERSION_TAG>.hex, also creates wii5_buoy_latest.hex symlink.
|
||||
# - Without: builds the current HEAD as a 'dev' build.
|
||||
#
|
||||
# Configure via env vars:
|
||||
: "${WII5_BUILD_DIR:?set to your Arduino build dir}"
|
||||
: "${WII5_FIRMWARE_REPO:?path to firmware-archive git repo}"
|
||||
: "${WII5_ARDUINO_BIN:=arduino}"
|
||||
|
||||
set -e
|
||||
|
||||
VERSION=$1
|
||||
SHORT=$(git log -1 --pretty=format:%h)
|
||||
VERSION_STRING="WII5Buoy_$VERSION"
|
||||
LINK=""
|
||||
INTVER=""
|
||||
|
||||
if [[ $VERSION == '' ]]
|
||||
then
|
||||
# TODO: keep versions with SHORT and link "latest" -> latest dev
|
||||
VERSION_STRING="WII5Buoy_dev_$SHORT"
|
||||
VERSION="dev"
|
||||
INTVER="3"
|
||||
else
|
||||
git checkout $VERSION
|
||||
LINK="latest"
|
||||
INTVER=$(perl tools/integer_version.pl $VERSION)
|
||||
fi
|
||||
|
||||
echo "Getting and Building $VERSION with $VERSION_STRING"
|
||||
|
||||
"$WII5_ARDUINO_BIN" \
|
||||
--pref compiler.cpp.extra_flags="-DWII5_SOFTWARE_VERSION=\"$VERSION_STRING\" -DWII5_SOFTWARE_COMMIT=\"$SHORT\" -DWII5_SOFTWARE_INTVER=$INTVER" \
|
||||
--verify app/wii5_buoy/wii5_buoy.ino \
|
||||
--board WII:avr:wii5_v2_2560_3V:cpu=atmega25603V3_11MHz230400
|
||||
|
||||
sleep 1
|
||||
pushd "$WII5_FIRMWARE_REPO"
|
||||
git pull
|
||||
cp "$WII5_BUILD_DIR/wii5_buoy.ino.hex" "$WII5_FIRMWARE_REPO/wii5_buoy_$VERSION.hex"
|
||||
if [[ $LINK == '' ]]
|
||||
then
|
||||
echo "No link to DEV"
|
||||
else
|
||||
echo "Creating link to latest"
|
||||
touch wii5_buoy_$LINK.hex
|
||||
rm wii5_buoy_$LINK.hex
|
||||
ln -s wii5_buoy_$VERSION.hex wii5_buoy_$LINK.hex
|
||||
git add wii5_buoy_$LINK.hex
|
||||
fi
|
||||
git add wii5_buoy_$VERSION.hex
|
||||
git commit -am "Auto build $VERSION $VERSION_STRING"
|
||||
git push
|
||||
popd
|
||||
|
||||
git checkout master
|
||||
Reference in New Issue
Block a user