altos: Merge GPS logging into a single function
[fw/altos] / src / product / ao_terraui.c
index 8875ff487b7438040a9f8dd9478f8428e1f2bb61..8fd97033d6533329bd25af5d0e5ee3bb453f36ff 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include "ao.h"
+#include <ao_flight.h>
 #include <math.h>
 
 static __xdata struct ao_telemetry_sensor              ao_tel_sensor;
@@ -593,7 +594,7 @@ ao_terramonitor(void)
                        continue;
                if (!(ao_monitor_ring[monitor].all.status & PKT_APPEND_STATUS_1_CRC_OK))
                        continue;
-               ao_tel_rssi = (ao_monitor_ring[monitor].all.rssi >> 1) - 74;
+               ao_tel_rssi = AO_RSSI_FROM_RADIO(ao_monitor_ring[monitor].all.rssi);
                switch (ao_monitor_ring[monitor].all.telemetry.generic.type) {
                case AO_TELEMETRY_SENSOR_TELEMETRUM:
                case AO_TELEMETRY_SENSOR_TELEMINI:
@@ -628,7 +629,7 @@ ao_terragps(void)
 
        for (;;) {
                while (ao_gps_tick == gps_tick)
-                       ao_sleep(&ao_gps_data);
+                       ao_sleep(&ao_gps_new);
                gps_tick = ao_gps_tick;
                ao_gps_progress = (ao_gps_progress + 1) & 3;
        }