Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
main_fbw.c File Reference

FBW main loop. More...

#include "main_fbw.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "modules/datalink/datalink.h"
#include "modules/datalink/telemetry.h"
+ Include dependency graph for main_fbw.c:

Go to the source code of this file.

Macros

#define MODULES_C
 
#define ABI_C
 
#define MAIN_FBW_RC_ID   ABI_BROADCAST
 ABI RC binding. More...
 

Functions

static void rc_cb (uint8_t sender_id, struct RadioControl *rc)
 Callback when we received an RC frame. More...
 
void main_fbw_init (void)
 Main initialization. More...
 
static void fbw_safety_check (void)
 Periodic tasks. More...
 
static void main_task_periodic (void)
 
void main_fbw_periodic (void)
 
void main_fbw_parse_EMERGENCY_CMD (uint8_t *buf)
 
void main_fbw_event (void)
 

Variables

uint8_t fbw_mode
 Fly by wire modes. More...
 
bool fbw_motors_on = false
 
tid_t periodic_tid
 IDs for timers. More...
 
tid_t radio_control_tid
 id for radio_control_periodic() timer More...
 
tid_t electrical_tid
 id for electrical_periodic() timer More...
 
tid_t telemetry_tid
 id for telemetry_periodic() timer More...
 
static abi_event rc_ev
 

Detailed Description

FBW main loop.

Definition in file main_fbw.c.

Macro Definition Documentation

◆ ABI_C

#define ABI_C

Definition at line 31 of file main_fbw.c.

◆ MAIN_FBW_RC_ID

#define MAIN_FBW_RC_ID   ABI_BROADCAST

ABI RC binding.

Definition at line 68 of file main_fbw.c.

◆ MODULES_C

#define MODULES_C

Definition at line 29 of file main_fbw.c.

Function Documentation

◆ fbw_safety_check()

static void fbw_safety_check ( void  )
static

◆ main_fbw_event()

void main_fbw_event ( void  )

Definition at line 263 of file main_fbw.c.

References intermcu_event().

+ Here is the call graph for this function:

◆ main_fbw_init()

void main_fbw_init ( void  )

Main initialization.

Definition at line 78 of file main_fbw.c.

References electrical_tid, fbw_mode, FBW_MODE_FAILSAFE, MAIN_FBW_RC_ID, periodic_tid, radio_control_tid, rc_cb(), rc_ev, sys_time_register_timer(), and telemetry_tid.

+ Here is the call graph for this function:

◆ main_fbw_parse_EMERGENCY_CMD()

void main_fbw_parse_EMERGENCY_CMD ( uint8_t buf)

Definition at line 256 of file main_fbw.c.

References fbw_mode, and FBW_MODE_FAILSAFE.

◆ main_fbw_periodic()

void main_fbw_periodic ( void  )

Definition at line 187 of file main_fbw.c.

References electrical_periodic(), electrical_tid, main_task_periodic(), periodic_tid, radio_control_tid, sys_time_check_and_ack_timer(), and telemetry_tid.

+ Here is the call graph for this function:

◆ main_task_periodic()

static void main_task_periodic ( void  )
static

Definition at line 142 of file main_fbw.c.

References commands_failsafe, fbw_mode, FBW_MODE_AUTO, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, fbw_motors_on, fbw_safety_check(), intermcu, intermcu_ap_motors_on, intermcu_commands, LED_OFF, LED_ON, and LED_TOGGLE.

Referenced by main_fbw_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rc_cb()

static void rc_cb ( uint8_t sender_id  ,
struct RadioControl rc 
)
static

Callback when we received an RC frame.

Definition at line 214 of file main_fbw.c.

References AP_LOST_FBW_MODE, commands, commands_failsafe, fbw_mode, FBW_MODE_AUTO, FBW_MODE_AUTO_ONLY, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, fbw_motors_on, intermcu, INTERMCU_LOST, MIN_PPRZ, radio_control, RADIO_FBW_MODE, RADIO_KILL_SWITCH, intermcu_t::status, and RadioControl::values.

Referenced by main_fbw_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ electrical_tid

tid_t electrical_tid

id for electrical_periodic() timer

Definition at line 61 of file main_fbw.c.

Referenced by main_fbw_init(), and main_fbw_periodic().

◆ fbw_mode

◆ fbw_motors_on

bool fbw_motors_on = false

Definition at line 42 of file main_fbw.c.

Referenced by main_task_periodic(), and rc_cb().

◆ periodic_tid

tid_t periodic_tid

IDs for timers.

id for general periodic task timer

Definition at line 59 of file main_fbw.c.

Referenced by main_fbw_init(), and main_fbw_periodic().

◆ radio_control_tid

tid_t radio_control_tid

id for radio_control_periodic() timer

Definition at line 60 of file main_fbw.c.

Referenced by main_fbw_init(), and main_fbw_periodic().

◆ rc_ev

abi_event rc_ev
static

Definition at line 71 of file main_fbw.c.

Referenced by main_fbw_init().

◆ telemetry_tid

tid_t telemetry_tid

id for telemetry_periodic() timer

Definition at line 62 of file main_fbw.c.

Referenced by main_fbw_init(), and main_fbw_periodic().