altos/test: Use ao_convert.c instead of hand-coded pres → alt func
[fw/altos] / src / ao_flight_test.c
index 8ce94895026213b2954124d7f548d733030fb6d7..70888d34448cd090029f951db7e33d1f38e1c9c7 100644 (file)
@@ -114,35 +114,11 @@ const char const * const ao_state_names[] = {
 };
 
 struct ao_cmds {
-       char            cmd;
        void            (*func)(void);
        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;
@@ -156,6 +132,15 @@ struct ao_config ao_config;
 
 #define DATA_TO_XDATA(x) (x)
 
+#define HAS_FLIGHT 1
+#define HAS_ADC 1
+#define HAS_USB 1
+#define HAS_GPS 1
+#ifndef HAS_ACCEL
+#define HAS_ACCEL 1
+#endif
+#define HAS_ACCEL_REF 0
+
 #include "ao_flight.c"
 
 void