diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-08-17 14:58:32 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-24 19:08:20 +0000 |
commit | 0e01759cedcd25868196508177791388b89450e5 (patch) | |
tree | d361152082ad7a92a37d3e5fb9d7981202c40b19 /test/motion_lid.c | |
parent | de42bb285fa45a777ed7a27be9f4c99c8f606ed8 (diff) | |
download | chrome-ec-0e01759cedcd25868196508177791388b89450e5.tar.gz |
math: Add inverse matrix calculation
Add a slow inverse matrix calculation function.
It is needed to apply factory offset properly.
Also consider the NULL matrix the identity matrix.
BRANCH=smaug,cyan
TEST=Unit test
BUG=chromium:517675
Change-Id: Ifa11954992e6f2fab02b4e92684e7b01bbaafe94
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294594
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'test/motion_lid.c')
-rw-r--r-- | test/motion_lid.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c index 18c4f64f33..d204ec4ab0 100644 --- a/test/motion_lid.c +++ b/test/motion_lid.c @@ -40,10 +40,7 @@ static int accel_init(const struct motion_sensor_t *s) static int accel_read(const struct motion_sensor_t *s, vector_3_t v) { - if (*s->rot_standard_ref != NULL) - rotate(s->xyz, *s->rot_standard_ref, v); - else if (s->xyz != v) - memcpy(v, s->xyz, sizeof(v)); + rotate(s->xyz, *s->rot_standard_ref, v); return EC_SUCCESS; } |