summaryrefslogtreecommitdiff
path: root/include/math_util.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-09-11 12:02:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-13 05:28:54 -0700
commit828b55a7358ad5ec8bc27552bfb280eb173dd453 (patch)
treeb9430d2bf624ee2b6976eed211696b50ae56decb /include/math_util.h
parent0647f66f81de880af603a7fb70f57159519782ac (diff)
downloadchrome-ec-828b55a7358ad5ec8bc27552bfb280eb173dd453.tar.gz
common: Add magnetometer online calibration.
Code for hard iron calibration: Every seconds (or faster if enough samples), find a sphere that fit the compass data. Based on Android code. BRANCH=smaug BUG=chrome-os-partner:39900 TEST=Check hard-iron bias is removed. Works better outside. Change-Id: Iab479d5113b6560b4f01b0fd87373d2eecdb9b54 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/299583 Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'include/math_util.h')
-rw-r--r--include/math_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/math_util.h b/include/math_util.h
index 0dd11c230b..385c044c6f 100644
--- a/include/math_util.h
+++ b/include/math_util.h
@@ -99,9 +99,9 @@ typedef fp_t matrix_3x3_t[3][3];
/* Integer vector */
typedef int vector_3_t[3];
-/* For vector_3_t, define which coordinates are in which location. */
+/* For vectors, define which coordinates are in which location. */
enum {
- X, Y, Z
+ X, Y, Z, W
};
/*
* Return absolute value of x. Note that as a macro expansion, this may have