summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-02-01 23:16:32 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-04 03:16:09 +0000
commitf051362829eae11ef620ebc4881b16793fa61589 (patch)
tree666fa57b5e4b16304463c4b4e9f65e946efa5129
parent56f8be436a8fc4b5f73508e7ba84304958adfede (diff)
downloadchrome-ec-f051362829eae11ef620ebc4881b16793fa61589.tar.gz
common: mag_cal: Trigger online calibration with more samples
For the online calibration to work, sensor data must be collected while the device is in different positions. The current implementation starts calibration after 25 samples/1 second. It means the device should done a figure 8 - or close to it - in that lapse of time. This is fine for phones or small devices, but not for heavy convertible. Increase the batch size to at least 50 samples or 2 seconds of collection. BUG=b:144027014 BRANCH=reef TEST=Pass RVCVXCheckTestActivity verifier test. (cherry picked from commit 2ef4580322d1041c6492ea33058fd4b139d36180) Change-Id: I78d1b943c23eaa9a29831ad4344c8be36ea00b79 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2034677 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--include/mag_cal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mag_cal.h b/include/mag_cal.h
index 5c12e00be7..a730fcbe59 100644
--- a/include/mag_cal.h
+++ b/include/mag_cal.h
@@ -14,8 +14,8 @@
#include "kasa.h"
#define MAG_CAL_MAX_SAMPLES 0xffff
-#define MAG_CAL_MIN_BATCH_WINDOW_US SECOND
-#define MAG_CAL_MIN_BATCH_SIZE 25 /* samples */
+#define MAG_CAL_MIN_BATCH_WINDOW_US (2 * SECOND)
+#define MAG_CAL_MIN_BATCH_SIZE 50 /* samples */
struct mag_cal_t {
struct kasa_fit kasa_fit;