summaryrefslogtreecommitdiff
path: root/src/core/ao_convert_pa_test.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-18 15:18:52 -0700
committerKeith Packard <keithp@keithp.com>2012-10-18 15:18:52 -0700
commit5a55501660ebab3b858a48483c5df1cfb4e858e4 (patch)
tree9b5d8305d9c65b10f82f6839bb1b5c169681ef00 /src/core/ao_convert_pa_test.c
parent0361235c9ef56738ba0e97be88a85afef0ce8268 (diff)
parent440365bd17d804c2f574c35164612cf1682397d7 (diff)
Merge branch 'master' into mm-ms5611
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao_convert_pa_test.c')
-rw-r--r--src/core/ao_convert_pa_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/ao_convert_pa_test.c b/src/core/ao_convert_pa_test.c
index 972a4d4c..7d5b1922 100644
--- a/src/core/ao_convert_pa_test.c
+++ b/src/core/ao_convert_pa_test.c
@@ -17,15 +17,17 @@
#include <stdint.h>
#define AO_CONVERT_TEST
+typedef int32_t alt_t;
#include "ao_host.h"
#include "ao_convert_pa.c"
#define STEP_P 1
#define STEP_A 1
-static inline i_abs(int i) { return i < 0 ? -i : i; }
+static inline int i_abs(int i) { return i < 0 ? -i : i; }
-main ()
+int
+main (int argc, char **argv)
{
int i;
int32_t p_to_a, p_to_a_to_p;
@@ -49,9 +51,7 @@ main ()
// printf ("pa %d alt %d pa %d\n",
// i, p_to_a, p_to_a_to_p);
}
- for (i = -1450; i < 74250 + STEP_A; i += STEP_A) {
- if (i > 74250)
- i = 74250;
+ for (i = -1450; i < 40000 + STEP_A; i += STEP_A) {
a_to_p = ao_altitude_to_pa(i);
a_to_p_to_a = ao_pa_to_altitude(a_to_p);
a_error = i_abs(a_to_p_to_a - i);