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

Recovery mode: run manual mode in case of hardfault Based on legacy FBW. More...

#include "firmwares/fixedwing/main_recovery.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "modules/radio_control/radio_control.h"
#include "modules/core/commands.h"
#include "modules/energy/electrical.h"
#include "autopilot_utils.h"
#include "modules/datalink/telemetry.h"
+ Include dependency graph for main_recovery.c:

Go to the source code of this file.

Macros

#define RECOVERY_RC_ID   ABI_BROADCAST
 
#define RECOVERY_MODE_OF_PPRZ(mode)   ((mode) < THRESHOLD_MANUAL_PPRZ ? RECOVERY_MODE_MANUAL : RECOVERY_MODE_FAILSAFE)
 

Functions

static void rc_cb (uint8_t sender_id, struct RadioControl *rc)
 
static void send_fbw_status (struct transport_tx *trans, struct link_device *dev)
 
void main_recovery_init (void)
 
void main_recovery_event (void)
 
void main_recovery_periodic (void)
 

Variables

uint8_t recovery_mode
 
tid_t periodic_tid
 id for periodic task timer More...
 
tid_t electrical_tid
 id for electrical_periodic() timer More...
 
tid_t telemetry_tid
 id for periodic telemetry More...
 
static abi_event rc_ev
 

Detailed Description

Recovery mode: run manual mode in case of hardfault Based on legacy FBW.

Definition in file main_recovery.c.

Macro Definition Documentation

◆ RECOVERY_MODE_OF_PPRZ

#define RECOVERY_MODE_OF_PPRZ (   mode)    ((mode) < THRESHOLD_MANUAL_PPRZ ? RECOVERY_MODE_MANUAL : RECOVERY_MODE_FAILSAFE)

Definition at line 56 of file main_recovery.c.

◆ RECOVERY_RC_ID

#define RECOVERY_RC_ID   ABI_BROADCAST

Definition at line 51 of file main_recovery.c.

Function Documentation

◆ main_recovery_event()

void main_recovery_event ( void  )

Definition at line 126 of file main_recovery.c.

◆ main_recovery_init()

void main_recovery_init ( void  )

◆ main_recovery_periodic()

◆ rc_cb()

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

Definition at line 58 of file main_recovery.c.

References commands, RADIO_MODE, RC_OK, recovery_mode, RECOVERY_MODE_MANUAL, RECOVERY_MODE_OF_PPRZ, RadioControl::status, and RadioControl::values.

Referenced by main_recovery_init().

+ Here is the caller graph for this function:

◆ send_fbw_status()

static void send_fbw_status ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 72 of file main_recovery.c.

References Electrical::current, dev, electrical, RadioControl::frame_rate, radio_control, recovery_mode, RadioControl::status, and Electrical::vsupply.

Referenced by main_recovery_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 45 of file main_recovery.c.

Referenced by main_recovery_init(), and main_recovery_periodic().

◆ periodic_tid

tid_t periodic_tid

id for periodic task timer

Definition at line 44 of file main_recovery.c.

Referenced by main_recovery_init(), and main_recovery_periodic().

◆ rc_ev

abi_event rc_ev
static

Definition at line 54 of file main_recovery.c.

Referenced by main_recovery_init().

◆ recovery_mode

uint8_t recovery_mode

Definition at line 42 of file main_recovery.c.

Referenced by main_recovery_init(), main_recovery_periodic(), rc_cb(), and send_fbw_status().

◆ telemetry_tid

tid_t telemetry_tid

id for periodic telemetry

Definition at line 47 of file main_recovery.c.

Referenced by main_recovery_init(), and main_recovery_periodic().