Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
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 TELEMETRY_FREQUENCY   60
 
#define MODULES_FREQUENCY   512
 
#define BARO_PERIODIC_FREQUENCY   50
 

Functions

static void on_gyro_event (void)
 
static void on_accel_event (void)
 
static void on_baro_abs_event (void)
 
static void on_baro_dif_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 baro_tid
 id for baro_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 BARO_PERIODIC_FREQUENCY   50

Definition at line 91 of file main.c.

Referenced by main_init().

#define MODULES_C

Definition at line 29 of file main.c.

#define MODULES_FREQUENCY   512

Definition at line 86 of file main.c.

Referenced by main_init().

#define TELEMETRY_FREQUENCY   60

Definition at line 81 of file main.c.

Referenced by main_init().

Function Documentation

STATIC_INLINE void failsafe_check ( void  )

Definition at line 215 of file main.c.

References AP_MODE_FAILSAFE, AP_MODE_KILL, AP_MODE_NAV, autopilot_mode, autopilot_motors_on, autopilot_set_mode(), GpsIsLost(), radio_control, RC_OK, and RadioControl::status.

Referenced by handle_periodic_tasks().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

STATIC_INLINE void handle_periodic_tasks ( void  )

Definition at line 177 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int main ( void  )

Definition at line 113 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 236 of file main.c.

References autopilot_on_rc_frame(), autopilot_rc, BaroEvent, DatalinkEvent, DetectGroundEvent(), GpsEvent, i2c_event(), ImuEvent, on_accel_event(), on_baro_abs_event(), on_baro_dif_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 194 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 262 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_baro_abs_event ( void  )
inlinestatic

Definition at line 291 of file main.c.

References ins_update_baro(), and vi_notify_baro_abs_available().

Referenced by main_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_baro_dif_event ( void  )
inlinestatic

Definition at line 298 of file main.c.

Referenced by main_event().

+ Here is the caller graph for this function:

static void on_gps_event ( void  )
inlinestatic

Definition at line 302 of file main.c.

References 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 270 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 310 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 211 of file main.c.

References DefaultChannel, and DefaultDevice.

Referenced by handle_periodic_tasks().

+ Here is the caller graph for this function:

Variable Documentation

tid_t baro_tid

id for baro_periodic() timer

Definition at line 109 of file main.c.

tid_t electrical_tid

id for electrical_periodic() timer

Definition at line 108 of file main.c.

tid_t failsafe_tid

id for failsafe_check() timer

Definition at line 106 of file main.c.

tid_t main_periodic_tid

id for main_periodic() timer

Definition at line 104 of file main.c.

tid_t modules_tid

id for modules_periodic_task() timer

Definition at line 105 of file main.c.

tid_t radio_control_tid

id for radio_control_periodic_task() timer

Definition at line 107 of file main.c.

tid_t telemetry_tid

id for telemetry_periodic() timer

Definition at line 110 of file main.c.