30 #include "generated/airframe.h"
34 #include "autopilot_rc_helpers.h"
38 #ifndef SAFETY_WARNING_LED
39 #error You must define SAFETY_WARNING_LED to use this module!
44 LED_ON(SAFETY_WARNING_LED);
51 RunXTimesEvery(0, 60, 5, 7, {
LED_TOGGLE(SAFETY_WARNING_LED);});
52 RunXTimesEvery(130, 130, 10, 6, {
LED_TOGGLE(SAFETY_WARNING_LED);});
54 RunXTimesEvery(20, 240, 40, 1, {
LED_ON(SAFETY_WARNING_LED);});
55 RunXTimesEvery(0, 240, 40, 1, {
LED_OFF(SAFETY_WARNING_LED);});
57 RunXTimesEvery(20, 240, 40, 2, {
LED_ON(SAFETY_WARNING_LED);});
58 RunXTimesEvery(0, 240, 40, 2, {
LED_OFF(SAFETY_WARNING_LED);});
60 RunXTimesEvery(20, 240, 40, 3, {
LED_ON(SAFETY_WARNING_LED);});
61 RunXTimesEvery(0, 240, 40, 3, {
LED_OFF(SAFETY_WARNING_LED);});
63 RunXTimesEvery(20, 240, 40, 4, {
LED_ON(SAFETY_WARNING_LED);});
64 RunXTimesEvery(0, 240, 40, 4, {
LED_OFF(SAFETY_WARNING_LED);});
66 RunXTimesEvery(20, 240, 40, 5, {
LED_ON(SAFETY_WARNING_LED);});
67 RunXTimesEvery(0, 240, 40, 5, {
LED_OFF(SAFETY_WARNING_LED);});
71 RunOnceEvery(20, {
LED_TOGGLE(SAFETY_WARNING_LED);});
73 RunXTimesEvery(0, 300, 10, 10, {
LED_TOGGLE(SAFETY_WARNING_LED);});
77 LED_ON(SAFETY_WARNING_LED);
#define THROTTLE_STICK_DOWN()
bool autopilot_get_motors_on(void)
get motors status
#define LOW_BAT_LEVEL
low battery level in Volts (for 3S LiPo)
#define MODE_MANUAL
Default RC mode.
Interface for electrical status: supply voltage, current, battery status, etc.
struct RadioControl radio_control
#define ROLL_STICK_CENTERED()
void led_safety_status_periodic(void)
Periodic function that makes the leds blink in the right pattern for each situation.
#define YAW_STICK_CENTERED()
Core autopilot interface common to all firmwares.
void led_safety_status_init(void)
Initialises periodic loop; place more init functions here if expanding driver.
#define PITCH_STICK_CENTERED()
uint16_t vsupply
supply voltage in decivolts
arch independent LED (Light Emitting Diodes) API
Simple module to blink LEDs when battery voltage drops below a certain level, radio control is lost o...
struct Electrical electrical
uint8_t autopilot_get_mode(void)
get autopilot mode