Beispiel #1
0
STATIC_INLINE void main_event(void)
{
  /* event functions for mcu peripherals: i2c, usb_serial.. */
  mcu_event();

  DatalinkEvent();

  if (autopilot_rc) {
    RadioControlEvent(autopilot_on_rc_frame);
  }

#if USE_IMU
  ImuEvent();
#endif

#ifdef InsEvent
  TODO("calling InsEvent, remove me..")
  InsEvent();
#endif

#if USE_BARO_BOARD
  BaroEvent();
#endif

#if USE_GPS
  GpsEvent();
#endif

#if FAILSAFE_GROUND_DETECT || KILL_ON_GROUND_DETECT
  DetectGroundEvent();
#endif

  modules_event_task();
}
Beispiel #2
0
/*********** EVENT ***********************************************************/
void event_task_ap( void ) {

#ifndef SINGLE_MCU
#if defined USE_I2C0  || defined USE_I2C1  || defined USE_I2C2
  i2c_event();
#endif
#endif

#if USE_AHRS && USE_IMU
  ImuEvent(on_gyro_event, on_accel_event, on_mag_event);
#endif

#if USE_INS
  InsEvent(NULL);
#endif

#if USE_GPS
  GpsEvent(on_gps_solution);
#endif /* USE_GPS */

#if USE_BAROMETER
  BaroEvent(on_baro_abs_event, on_baro_dif_event);
#endif

  DatalinkEvent();


#ifdef MCU_SPI_LINK
  link_mcu_event_task();
#endif

  if (inter_mcu_received_fbw) {
    /* receive radio control task from fbw */
    inter_mcu_received_fbw = FALSE;
    telecommand_task();
  }

  modules_event_task();

#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
  if (new_ins_attitude > 0)
  {
    attitude_loop();
    //LED_TOGGLE(3);
    new_ins_attitude = 0;
  }
#endif

} /* event_task_ap() */
Beispiel #3
0
/*********** EVENT ***********************************************************/
void event_task_ap( void ) {

#ifdef USE_INFRARED
  infrared_event();
#endif

#ifdef USE_AHRS
  ImuEvent(on_gyro_event, on_accel_event, on_mag_event);
#endif // USE_AHRS

#ifdef USE_GPS
  GpsEvent(on_gps_solution);
#endif /** USE_GPS */


  DatalinkEvent();


#ifdef MCU_SPI_LINK
    link_mcu_event_task();
#endif

  if (inter_mcu_received_fbw) {
    /* receive radio control task from fbw */
    inter_mcu_received_fbw = FALSE;
    telecommand_task();
  }

  modules_event_task();

#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
  if (new_ins_attitude > 0)
  {
    attitude_loop();
    //LED_TOGGLE(3);
    new_ins_attitude = 0;
  }
#endif

} /* event_task_ap() */