STATIC_INLINE void main_periodic(void) { #if USE_IMU imu_periodic(); #endif //FIXME: temporary hack, remove me #ifdef InsPeriodic InsPeriodic(); #endif /* run control loops */ autopilot_periodic(); /* set actuators */ //actuators_set(autopilot_motors_on); #ifndef INTER_MCU_AP SetActuatorsFromCommands(commands, autopilot_mode); #else intermcu_set_actuators(commands, autopilot_mode); #endif if (autopilot_in_flight) { RunOnceEvery(PERIODIC_FREQUENCY, autopilot_flight_time++); } #if defined DATALINK || defined SITL RunOnceEvery(PERIODIC_FREQUENCY, datalink_time++); #endif RunOnceEvery(10, LED_PERIODIC()); }
STATIC_INLINE void main_periodic(void) { #if INTER_MCU_AP /* Inter-MCU watchdog */ intermcu_periodic(); #endif /* run control loops */ autopilot_periodic(); /* set actuators */ //actuators_set(autopilot_motors_on); #ifndef INTER_MCU_AP SetActuatorsFromCommands(commands, autopilot_mode); #else intermcu_set_actuators(commands, autopilot_mode); #endif if (autopilot_in_flight) { RunOnceEvery(PERIODIC_FREQUENCY, autopilot_flight_time++); } #if defined DATALINK || defined SITL RunOnceEvery(PERIODIC_FREQUENCY, datalink_time++); #endif RunOnceEvery(10, LED_PERIODIC()); }