2024-09-29 20:39:30 +02:00
|
|
|
#!/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
|
|
|
|
;;
|
|
|
|
*)
|
2024-10-05 00:35:20 +02:00
|
|
|
script="${0##*/}"
|
2024-09-29 20:39:30 +02:00
|
|
|
cat <<EOF
|
2024-10-05 00:35:20 +02:00
|
|
|
Usage: $script {show|save}
|
2024-09-29 20:39:30 +02:00
|
|
|
|
|
|
|
Manage analog channel calibration.
|
|
|
|
|
2024-10-05 00:35:20 +02:00
|
|
|
$script show
|
2024-09-29 20:39:30 +02:00
|
|
|
Display calibration.
|
|
|
|
|
2024-10-05 00:35:20 +02:00
|
|
|
$script save
|
2024-09-29 20:39:30 +02:00
|
|
|
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 $?
|
|
|
|
|