altos/test: Get test code working again after restructuring
authorKeith Packard <keithp@keithp.com>
Fri, 18 Oct 2019 08:02:51 +0000 (01:02 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 18 Oct 2019 08:03:36 +0000 (01:03 -0700)
Something changed, the test code wasn't building. Now it does.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_host.h
src/test/ao_aprs_test.c
src/test/ao_flight_test.c

index f32218228ca29b658ee4a6782204957f77ed9343..e2f14e7963a38333c3a2f8686130d99e27006f3e 100644 (file)
@@ -41,12 +41,6 @@ struct ao_adc {
        int16_t         sense_m;        /* main continuity sense */
 };
 
-#define const
-
-#define a      (a)
-#define a      (a)
-#define a      (a)
-
 enum ao_flight_state {
        ao_flight_startup = 0,
        ao_flight_idle = 1,
index 941bf95471d1c14abfa891cd434ba951127f136c..f9cda60b183f99f8639a034217de2b6b0769b51a 100644 (file)
@@ -60,6 +60,7 @@ ao_aprs_bit(uint8_t bit)
 void
 ao_radio_send_aprs(ao_radio_fill_func fill);
 
+#if 0
 static void
 aprs_bit_debug(uint8_t tx_bit)
 {
@@ -71,8 +72,10 @@ aprs_byte_debug(uint8_t tx_byte)
 {
        fprintf(stderr, "byte %02x\n", tx_byte);
 }
+
 #define APRS_BIT_DEBUG(x) aprs_bit_debug(x)
 #define APRS_BYTE_DEBUG(y) aprs_byte_debug(y)
+#endif
 
 #include <ao_aprs.c>
 
@@ -103,6 +106,7 @@ aprs_byte_debug(uint8_t tx_byte)
 
  */
 
+#if 0
 static void
 audio_gap(int secs)
 {
@@ -113,6 +117,7 @@ audio_gap(int secs)
                ao_aprs_bit(0);
 #endif
 }
+#endif
 
 // This is where we go after reset.
 int main(int argc, char **argv)
index 35e0da3fc2903b0e1ef22a6ff7c9bdd2e33aaa4d..ff480e2db9fd7ff7890ebbc46f309870c51e9c64 100644 (file)
@@ -126,6 +126,15 @@ struct ao_adc {
 #define HAS_USB 1
 #define HAS_GPS 1
 
+int16_t
+ao_time(void);
+
+void
+ao_dump_state(void);
+
+#define ao_tick_count  (ao_time())
+#define ao_wakeup(wchan) ao_dump_state()
+
 #include <ao_data.h>
 #include <ao_log.h>
 #include <ao_telemetry.h>
@@ -237,7 +246,6 @@ int ao_summary = 0;
 #define ao_led_on(l)
 #define ao_led_off(l)
 #define ao_timer_set_adc_interval(i)
-#define ao_wakeup(wchan) ao_dump_state()
 #define ao_cmd_register(c)
 #define ao_usb_disable()
 #define ao_telemetry_set_interval(x)
@@ -315,9 +323,6 @@ char *emulator_info;
 double emulator_error_max = 4;
 double emulator_height_error_max = 20; /* noise in the baro sensor */
 
-void
-ao_dump_state(void);
-
 void
 ao_sleep(void *wchan);
 
@@ -647,6 +652,7 @@ ao_insert(void)
 #if TELEMEGA
                               " angle %5d "
                               "accel_x %8.3f accel_y %8.3f accel_z %8.3f gyro_x %8.3f gyro_y %8.3f gyro_z %8.3f mag_x %8d mag_y %8d, mag_z %8d mag_angle %4d "
+                              "avg_accel %8.3f "
 #endif
                               "\n",
                               time,
@@ -673,7 +679,8 @@ ao_insert(void)
                               ao_data_static.hmc5883.x,
                               ao_data_static.hmc5883.y,
                               ao_data_static.hmc5883.z,
-                              ao_mag_angle
+                              ao_mag_angle,
+                              ao_coast_avg_accel / 16.0
 #endif
                                );
 #endif