Files
ODrive/Firmware/build.sh
T
Samuel Sadok b8b483c9d6 Firmware hardening
- check return code of enqueue_modulation_timings
 - wrap all hardware access to safety critical hardware timer registers in safety_critical_ sections. These functions like the armed-ness of each PWM output to a corresponding armed state that can only be set at start or by the user
 - ensure NaN in any variables doesn't cause unpredictable behavior on the safety critical PWM outputs
2018-03-30 22:32:07 -07:00

27 lines
708 B
Bash
Executable File

#!/bin/bash
# Builds the firmware with the configuration specified by
# environment variables named CONFIG_...
# If DEPLOY is set, the deliverables are copied to Firmware/deploy/*
# with the suffix $DEPLOY
set -euo pipefail
THIS_DIR="$(dirname "$0")"
cd "$THIS_DIR"
# Treat warnings as errors
export CONFIG_STRICT=true
# Write all environment variables that start with "CONFIG_" to tup.config
rm -rdf build
mkdir -p build
env | grep ^CONFIG > tup.config
tup generate ./tup_build.sh
bash -xe ./tup_build.sh
# Deploy
if ! [ -z ${DEPLOY+x} ]; then
mkdir -p deploy
cp build/ODriveFirmware.elf deploy/ODriveFirmware_"$DEPLOY".elf
cp build/ODriveFirmware.hex deploy/ODriveFirmware_"$DEPLOY".hex
fi