summaryrefslogtreecommitdiff
path: root/include/mag_cal.h
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2018-10-04 10:19:57 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-04 12:55:53 -0700
commit315aaca9467f49bc432ef5f2de9c0e3bb56f0251 (patch)
tree3ea739aca1db340e93b9daee7958d5afc5c9f31f /include/mag_cal.h
parentece03ab4d09b157c5e6f3c4fe0446678c0d8684b (diff)
downloadchrome-ec-315aaca9467f49bc432ef5f2de9c0e3bb56f0251.tar.gz
mag_cal: Support fixed-point calculation.
Modified from floating point version. This includes changes to vec3, vec4, mat33, mat44, and mag_cal. Now fixed-point type (fp_*) functions is a function wrapper for both fixed-point and floating point version operations: * define CONFIG_FPU to use floating version mag_cal * undef CONFIG_FPU to use fixed-point version mag_cal Also, add tests for both float and fp types operations. TEST=define CONFIG_FPU; flash on reef; See ARC++ magnetmeter app moving. TEST=undef CONFIG_FPU; flash on reef; See ARC++ magnetmeter app moving. TEST=make runtests -j TEST=make buildalltests -j BUG=b:113364863 BRANCH=None Change-Id: Ie695945acb666912babb2a603e09c602a0624d44 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1260704 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/mag_cal.h')
-rw-r--r--include/mag_cal.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mag_cal.h b/include/mag_cal.h
index 753052f55f..b0b35ded6f 100644
--- a/include/mag_cal.h
+++ b/include/mag_cal.h
@@ -29,9 +29,9 @@ struct mag_cal_t {
* | x | y | z | 1 |
* +----+----+----+----+
*/
- mat44_float_t acc;
- floatv4_t acc_w;
- float radius;
+ mat44_fp_t acc;
+ fpv4_t acc_w;
+ fp_t radius;
intv3_t bias;