altos: Set reasonable accel values when !HAS_ACCEL
[fw/altos] / src / core / ao_telemetry.c
index 861580637d7e9c1e074d3d93472393b4f65d134e..a1c19185416fd56cdd3a1dac6bcabf892ef8ec0c 100644 (file)
@@ -24,9 +24,9 @@
 #endif
 
 static __pdata uint16_t ao_telemetry_interval;
-static __pdata uint8_t ao_rdf = 0;
 
 #if HAS_RDF
+static __pdata uint8_t ao_rdf = 0;
 static __pdata uint16_t ao_rdf_time;
 #endif
 
@@ -187,7 +187,9 @@ ao_send_metrum_sensor(void)
        telemetry.generic.type = AO_TELEMETRY_METRUM_SENSOR;
 
        telemetry.metrum_sensor.state = ao_flight_state;
+#if HAS_ACCEL
        telemetry.metrum_sensor.accel = ao_data_accel(packet);
+#endif
        telemetry.metrum_sensor.pres = ao_data_pres(packet);
        telemetry.metrum_sensor.temp = ao_data_temp(packet);
 
@@ -216,9 +218,15 @@ ao_send_metrum_data(void)
                telemetry.generic.type = AO_TELEMETRY_METRUM_DATA;
 
                telemetry.metrum_data.ground_pres = ao_ground_pres;
+#if HAS_ACCEL
                telemetry.metrum_data.ground_accel = ao_ground_accel;
                telemetry.metrum_data.accel_plus_g = ao_config.accel_plus_g;
                telemetry.metrum_data.accel_minus_g = ao_config.accel_minus_g;
+#else
+               telemetry.metrum_data.ground_accel = 1;
+               telemetry.metrum_data.accel_plus_g = 0;
+               telemetry.metrum_data.accel_minus_g = 2;
+#endif
 
                ao_radio_send(&telemetry, sizeof (telemetry));
                ao_telemetry_metrum_data_cur = ao_telemetry_metrum_data_max;