altos: Add logging and telem to telegps
[fw/altos] / src / core / ao_telemetry.c
index cfc72e048fe4b3c19f4c71fd41184be2dc110dcc..3aa315c765926cfa9e8cacf81c487fd1fc21caea 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include "ao.h"
+#include "ao_log.h"
 #include "ao_product.h"
 
 static __pdata uint16_t ao_telemetry_interval;
@@ -299,7 +300,6 @@ ao_telemetry(void)
 #endif
                while (ao_telemetry_interval) {
 
-
 #if HAS_APRS
                        if (!(ao_config.radio_enable & AO_RADIO_DISABLE_TELEMETRY))
 #endif
@@ -307,12 +307,14 @@ ao_telemetry(void)
 #ifdef AO_SEND_ALL_BARO
                                ao_send_baro();
 #endif
+#if HAS_FLIGHT
 #ifdef AO_SEND_MEGA
                                ao_send_mega_sensor();
                                ao_send_mega_data();
 #else
                                ao_send_sensor();
 #endif
+#endif
 
 #if HAS_COMPANION
                                if (ao_companion_running)
@@ -343,10 +345,10 @@ ao_telemetry(void)
                                        ao_radio_rdf();
                        }
 #if HAS_APRS
-                       if ((ao_config.radio_enable & AO_RADIO_ENABLE_APRS) &&
+                       if (ao_config.aprs_interval != 0 &&
                            (int16_t) (ao_time() - ao_aprs_time) >= 0)
                        {
-                               ao_aprs_time = ao_time() + AO_APRS_INTERVAL_TICKS;
+                               ao_aprs_time = ao_time() + AO_SEC_TO_TICKS(ao_config.aprs_interval);
                                ao_aprs_send();
                        }
 #endif