From e339ffd8bd8b9e3f4758017ba355028000cb612e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 6 Mar 2011 21:57:52 -0800 Subject: [PATCH] =?utf8?q?altos/test:=20Use=20ao=5Fconvert.c=20instead=20o?= =?utf8?q?f=20hand-coded=20pres=20=E2=86=92=20alt=20func?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix up ao_convert.c so that it can be used within the flight test code instead of having a (broken) copy of the code there. Signed-off-by: Keith Packard --- src/ao_convert.c | 2 +- src/ao_flight_test.c | 25 +------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/ao_convert.c b/src/ao_convert.c index cec4c29f..0969f107 100644 --- a/src/ao_convert.c +++ b/src/ao_convert.c @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef AO_CONVERT_TEST +#if !defined(AO_CONVERT_TEST) && !defined(AO_FLIGHT_TEST) #include "ao.h" #endif diff --git a/src/ao_flight_test.c b/src/ao_flight_test.c index e75bc8df..70888d34 100644 --- a/src/ao_flight_test.c +++ b/src/ao_flight_test.c @@ -118,30 +118,7 @@ struct ao_cmds { const char *help; }; - -static int16_t altitude_table[2048] = { -#include "altitude.h" -}; - -int16_t -ao_pres_to_altitude(int16_t pres) __reentrant -{ - pres = pres >> 4; - if (pres < 0) pres = 0; - if (pres > 2047) pres = 2047; - return altitude_table[pres]; -} - -int16_t -ao_altitude_to_pres(int16_t alt) __reentrant -{ - int16_t pres; - - for (pres = 0; pres < 2047; pres++) - if (altitude_table[pres] <= alt) - break; - return pres << 4; -} +#include "ao_convert.c" struct ao_config { uint16_t main_deploy; -- 2.30.2