Fix gyro orientation offset for EONs with OP3T mainboards (#1738)

* One-time zap of OP3T sensor registry

* Bash, I wish I knew how to quit you

* Better comment wording

* Slight increase for sensor reset settle-time

Co-authored-by: Comma Device <device@comma.ai>
albatross
Jason Young 2020-07-06 02:10:14 -07:00 committed by GitHub
parent c4b5322b7f
commit c2c00f65a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -99,6 +99,18 @@ function launch {
fi
fi
# One-time fix for a subset of OP3T with gyro orientation offsets.
# Remove and regenerate qcom sensor registry. Only done on OP3T mainboards.
# Performed exactly once. The old registry is preserved just-in-case, and
# doubles as a flag denoting we've already done the reset.
# TODO: we should really grow per-platform detect and setup routines
if ! $(grep -q "letv" /proc/cmdline) && [ ! -f "/persist/comma/op3t-sns-reg-backup" ]; then
echo "Performing OP3T sensor registry reset"
mv /persist/sensors/sns.reg /persist/comma/op3t-sns-reg-backup &&
rm -f /persist/sensors/sensors_settings /persist/sensors/error_log /persist/sensors/gyro_sensitity_cal &&
echo "restart" > /sys/kernel/debug/msm_subsys/slpi &&
sleep 5 # Give Android sensor subsystem a moment to recover
fi
# handle pythonpath
ln -sfn $(pwd) /data/pythonpath