From c2c00f65a70905ebc4d912cf5126bb18169e2cbd Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Mon, 6 Jul 2020 02:10:14 -0700 Subject: [PATCH] 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 --- launch_chffrplus.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 60102fbd..3ef93eb4 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -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