summaryrefslogtreecommitdiff
path: root/common/math_util.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2014-10-28 17:52:52 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-09 01:07:07 +0000
commit96a39e7ee73f7781f57b330bfd0be96d822366e6 (patch)
tree33eba330254609ce411703e89e883b64eef4ddd2 /common/math_util.c
parentbbe9a877ecc4f81fc17011b29a0d3bd13eac4540 (diff)
downloadchrome-ec-96a39e7ee73f7781f57b330bfd0be96d822366e6.tar.gz
math: use CONFIG_FPU when using float.
ifdef code than needs CONFIG_FPU (acos and friends) BRANCH=ToT BUG=chrome-os-partner:32050 TEST=define CONFIG_FPU on host board and use it. Change-Id: I1c4ed16c23450bb4059d26044f4c1fe45b33674e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/226414 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'common/math_util.c')
-rw-r--r--common/math_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/math_util.c b/common/math_util.c
index 83bfc6cdfb..56688283f4 100644
--- a/common/math_util.c
+++ b/common/math_util.c
@@ -14,6 +14,7 @@
#define COSINE_LUT_INCR_DEG 5
#define COSINE_LUT_SIZE ((180 / COSINE_LUT_INCR_DEG) + 1)
+#ifdef CONFIG_FPU
/* Lookup table for the value of cosine from 0 degrees to 180 degrees. */
static const float cos_lut[] = {
1.00000, 0.99619, 0.98481, 0.96593, 0.93969,
@@ -83,6 +84,7 @@ float cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2)
return (float)dotproduct / (denominator);
}
+#endif
/*
* rotate a vector v