altoslib: Missed a couple of easy mini voltage API changes
[fw/altos] / src / core / ao_log_mega.c
index e03687ada912d8352527179caa9117e8645bd630..768947d541728159f7e86d16c30d2122ad4a4914 100644 (file)
@@ -23,7 +23,7 @@
 static __xdata uint8_t ao_log_mutex;
 static __xdata struct ao_log_mega log;
 
-__code uint8_t ao_log_format = AO_LOG_FORMAT_MEGAMETRUM;
+__code uint8_t ao_log_format = AO_LOG_FORMAT_TELEMEGA;
 
 static uint8_t
 ao_log_csum(__xdata uint8_t *b) __reentrant
@@ -65,6 +65,7 @@ ao_log_dump_check_data(void)
        return 1;
 }
 
+#if HAS_ADC
 static __data uint8_t  ao_log_data_pos;
 
 /* a hack to make sure that ao_log_megas fill the eeprom block in even units */
@@ -151,6 +152,7 @@ ao_log(void)
                                log.u.volt.n_sense = AO_ADC_NUM_SENSE;
                                for (i = 0; i < AO_ADC_NUM_SENSE; i++)
                                        log.u.volt.sense[i] = ao_data_ring[ao_log_data_pos].adc.sense[i];
+                               log.u.volt.pyro = ao_pyro_fired;
                                ao_log_mega(&log);
                                next_other = log.tick + AO_OTHER_INTERVAL;
                        }
@@ -171,6 +173,8 @@ ao_log(void)
                }
 #endif
 
+               ao_log_flush();
+
                /* Wait for a while */
                ao_delay(AO_MS_TO_TICKS(100));
 
@@ -179,6 +183,7 @@ ao_log(void)
                        ao_sleep(&ao_log_running);
        }
 }
+#endif
 
 uint16_t
 ao_log_flight(uint8_t slot)