redpitaya-puzzlefw/sw/buildroot_overlay/opt/puzzlefw/bin/puzzle-calibration

47 lines
734 B
Bash
Executable File

#!/bin/sh
#
# Manage analog channel calibration.
#
. /opt/puzzlefw/lib/functions.sh
# Copy calibration file to the SD card.
cal_save() {
# Lock to avoid conflicting changes.
lock_config || exit 1
echo "Copying changed calibration to SD card ..."
sync_config calibration.conf || exit 1
}
case "$1" in
show)
cat ${CONFIG_DIR}/calibration.conf
;;
save)
cal_save
;;
*)
cat <<EOF
Usage: $0 {show|save}
Manage analog channel calibration.
$0 show
Display calibration.
$0 save
Copy a changed calibration file to the SD card.
Before running this command, the changed calibration must be written to
${CONFIG_DIR}/calibration.conf.new.
EOF
exit 1
;;
esac
exit $?