move PERF_COUNTER_TOTAL after usb_detect
@@ -260,19 +260,6 @@ int main() {
perf_counter_start(PERF_COUNTER_BLACKBOX);
blackbox_update();
perf_counter_end(PERF_COUNTER_BLACKBOX);
-
- if (usb_detect()) {
- flags.usb_active = 1;
-#ifndef ALLOW_USB_ARMING
- if (rx_aux_on(AUX_ARMING))
- flags.arm_safety = 1; //final safety check to disallow arming during USB operation
-#endif
- usb_configurator();
- } else {
- flags.usb_active = 0;
- extern usb_motor_test_t usb_motor_test;
- usb_motor_test.active = 0;
- }
#endif
state.cpu_load = (timer_micros() - lastlooptime);
@@ -321,6 +308,21 @@ int main() {
perf_counter_end(PERF_COUNTER_TOTAL);
perf_counter_update();
+#ifdef STM32F4
+ if (usb_detect()) {
+ flags.usb_active = 1;
+#ifndef ALLOW_USB_ARMING
+ if (rx_aux_on(AUX_ARMING))
+ flags.arm_safety = 1; //final safety check to disallow arming during USB operation
+#endif
+ usb_configurator();
+ } else {
+ flags.usb_active = 0;
+ extern usb_motor_test_t usb_motor_test;
+ usb_motor_test.active = 0;
+ }
+#endif
+
while ((timer_micros() - time) < state.looptime_autodetect)
__NOP();
