Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
main.c File Reference

Rotorcraft main loop. More...

+ Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define MODULES_C
 
#define ABI_C
 
#define BARO_PERIODIC_FREQUENCY   50
 
#define RC_LOST_MODE   AP_MODE_FAILSAFE
 mode to enter when RC is lost while using a mode with RC input (not AP_MODE_NAV) More...
 

Functions

static void on_gyro_event (void)
 
static void on_accel_event (void)
 
static void on_gps_event (void)
 
static void on_mag_event (void)
 
int main (void)
 
STATIC_INLINE void main_init (void)
 
STATIC_INLINE void handle_periodic_tasks (void)
 
STATIC_INLINE void main_periodic (void)
 
STATIC_INLINE void telemetry_periodic (void)
 
STATIC_INLINE void failsafe_check (void)
 
STATIC_INLINE void main_event (void)
 

Variables

tid_t main_periodic_tid
 id for main_periodic() timer More...
 
tid_t modules_tid
 id for modules_periodic_task() timer More...
 
tid_t failsafe_tid
 id for failsafe_check() timer More...
 
tid_t radio_control_tid
 id for radio_control_periodic_task() timer More...
 
tid_t electrical_tid
 id for electrical_periodic() timer More...
 
tid_t telemetry_tid
 id for telemetry_periodic() timer More...
 

Detailed Description

Rotorcraft main loop.

Definition in file main.c.

Macro Definition Documentation

#define ABI_C

Definition at line 31 of file main.c.

#define BARO_PERIODIC_FREQUENCY   50

Definition at line 101 of file main.c.

Referenced by alt_kalman(), init_ap(), and main_init().

#define MODULES_C

Definition at line 29 of file main.c.

#define RC_LOST_MODE   AP_MODE_FAILSAFE

mode to enter when RC is lost while using a mode with RC input (not AP_MODE_NAV)

Definition at line 242 of file main.c.

Referenced by failsafe_check().

Function Documentation

STATIC_INLINE void failsafe_check ( void  )
STATIC_INLINE void handle_periodic_tasks ( void  )

Definition at line 200 of file main.c.

References baro_periodic(), electrical_periodic(), failsafe_check(), main_periodic(), radio_control_periodic_task(), sys_time_check_and_ack_timer(), and telemetry_periodic().

Referenced by main(), and pprz_thd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int main ( void  )

Definition at line 129 of file main.c.

References handle_periodic_tasks(), main_event(), and main_init().

+ Here is the call graph for this function:

static void main_event ( void  )
inline

Definition at line 285 of file main.c.

References autopilot_on_rc_frame(), autopilot_rc, BaroEvent, DatalinkEvent, DetectGroundEvent(), GpsEvent, i2c_event(), ImuEvent, on_accel_event(), on_gps_event(), on_gyro_event(), on_mag_event(), and RadioControlEvent.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void main_init ( void  )
inline
static void main_periodic ( void  )
inline

Definition at line 219 of file main.c.

References autopilot_flight_time, autopilot_in_flight, autopilot_mode, autopilot_periodic(), commands, datalink_time, imu_periodic(), LED_PERIODIC, PERIODIC_FREQUENCY, and SetActuatorsFromCommands.

Referenced by handle_periodic_tasks().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_accel_event ( void  )
inlinestatic

Definition at line 313 of file main.c.

References ahrs, AHRS_UNINIT, ahrs_update_accel(), imu, ImuScaleAccel, and Ahrs::status.

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_gps_event ( void  )
inlinestatic

Definition at line 342 of file main.c.

References ahrs_update_gps(), GpsState::fix, gps, GPS_FIX_3D, ins_update_gps(), and vi_notify_gps_available().

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_gyro_event ( void  )
inlinestatic

Definition at line 321 of file main.c.

References ahrs, ahrs_align(), ahrs_aligner, AHRS_ALIGNER_LOCKED, ahrs_aligner_run(), ahrs_propagate(), AHRS_UNINIT, imu, ImuScaleGyro, ins_propagate(), Ahrs::status, AhrsAligner::status, and vi_notify_imu_available().

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_mag_event ( void  )
inlinestatic

Definition at line 351 of file main.c.

References ahrs, AHRS_RUNNING, ahrs_update_mag(), imu, ImuScaleMag, Ahrs::status, and vi_notify_mag_available().

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

STATIC_INLINE void telemetry_periodic ( void  )

Definition at line 236 of file main.c.

Referenced by handle_periodic_tasks().

+ Here is the caller graph for this function:

Variable Documentation

tid_t electrical_tid

id for electrical_periodic() timer

Definition at line 122 of file main.c.

tid_t failsafe_tid

id for failsafe_check() timer

Definition at line 120 of file main.c.

tid_t main_periodic_tid

id for main_periodic() timer

Definition at line 118 of file main.c.

tid_t modules_tid

id for modules_periodic_task() timer

Definition at line 119 of file main.c.

tid_t radio_control_tid

id for radio_control_periodic_task() timer

Definition at line 121 of file main.c.

tid_t telemetry_tid

id for telemetry_periodic() timer

Definition at line 123 of file main.c.