altos/micropeak-v2.0: Go into standby mode after landing
[fw/altos] / src / micropeak-v2.0 / ao_micropeak.c
index 6343be9ff2d1e54a20565791ab940e2d09e4657c..c3f06207a5cd3bd4962589eb974d5f7a03d8619c 100644 (file)
@@ -176,11 +176,12 @@ ao_micropeak(void)
        /* Give the person a second to get their finger out of the way */
        ao_delay(AO_MS_TO_TICKS(1000));
 
-       ao_pips();
-
        ao_log_micro_restore();
        ao_compute_height();
        ao_report_altitude();
+
+       ao_pips();
+
        ao_log_micro_dump();
 
 #if BOOST_DELAY
@@ -193,6 +194,7 @@ ao_micropeak(void)
        ao_compute_height();
        ao_report_altitude();
 
+       ao_sleep_mode();
        ao_sleep(&ao_on_battery);
 }
 
@@ -243,6 +245,11 @@ ao_hsi_init(void)
 void
 main(void)
 {
+       int i;
+
+       for (i = 0; i < 100000; i++)
+               ao_arch_nop();
+
        if (ao_battery_voltage() < 320)
                ao_on_battery = 1;