rc.thermal_cal
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
#
# Thermal Calibration startup script.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
set TEMP_COMP_START ""
if param compare -s TC_A_ENABLE 1
then
set TEMP_COMP_START "true"
fi
if param compare -s TC_B_ENABLE 1
then
set TEMP_COMP_START "true"
fi
if param compare -s TC_G_ENABLE 1
then
set TEMP_COMP_START "true"
fi
if [ "x$TEMP_COMP_START" != "x" ]
then
temperature_compensation start
fi
unset TEMP_COMP_START
#
# Determine if a thermal calibration should be started.
#
set TEMP_CALIB_ARGS ""
if param compare SYS_CAL_ACCEL 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -a"
param set SYS_CAL_ACCEL 0
fi
if param compare SYS_CAL_GYRO 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -g"
param set SYS_CAL_GYRO 0
fi
if param compare SYS_CAL_BARO 1
then
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -b"
param set SYS_CAL_BARO 0
fi
#
# Start the thermal calibration cycle.
#
if [ "x$TEMP_CALIB_ARGS" != "x" ]
then
temperature_compensation calibrate ${TEMP_CALIB_ARGS}
fi
unset TEMP_CALIB_ARGS