From 96a39e7ee73f7781f57b330bfd0be96d822366e6 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Tue, 28 Oct 2014 17:52:52 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/226414 Reviewed-by: Alec Berg Reviewed-by: Sheng-liang Song --- include/math_util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/math_util.h') diff --git a/include/math_util.h b/include/math_util.h index 044c411b23..6ae36a995b 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -8,7 +8,12 @@ #ifndef __CROS_MATH_UTIL_H #define __CROS_MATH_UTIL_H +#ifdef CONFIG_FPU typedef float matrix_3x3_t[3][3]; +#else +typedef int matrix_3x3_t[3][3]; +#endif + typedef int vector_3_t[3]; @@ -16,6 +21,7 @@ typedef int vector_3_t[3]; #define SQ(x) ((x) * (x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) +#ifdef CONFIG_FPU /** * Find acos(x) in degrees. Argument is clipped to [-1.0, 1.0]. @@ -36,6 +42,8 @@ float arc_cos(float x); */ float cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2); +#endif + /** * Rotate vector v by rotation matrix R. * -- cgit v1.2.1