altos: Leave USB enabled in flight with -DDEBUG=1
[fw/altos] / src / kernel / ao_flight.c
index 251dbc02a7f35eaa7994c1541af5be3800205f84..9031a54ae070e97e42a6d182e0d4b802e9897918 100644 (file)
@@ -130,7 +130,7 @@ ao_flight(void)
                        {
                                /* Set pad mode - we can fly! */
                                ao_flight_state = ao_flight_pad;
-#if HAS_USB && !HAS_FLIGHT_DEBUG && !HAS_SAMPLE_PROFILE
+#if HAS_USB && !HAS_FLIGHT_DEBUG && !HAS_SAMPLE_PROFILE && !DEBUG
                                /* Disable the USB controller in flight mode
                                 * to save power
                                 */
@@ -370,8 +370,10 @@ ao_flight(void)
                                {
                                        ao_flight_state = ao_flight_landed;
 
+#if HAS_ADC
                                        /* turn off the ADC capture */
                                        ao_timer_set_adc_interval(0);
+#endif
 
                                        ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
                                }