PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Safety button logic. More...
#include <px4_platform_common/px4_config.h>
#include <stdbool.h>
#include <drivers/drv_hrt.h>
#include "px4io.h"
Go to the source code of this file.
Macros | |
#define | LED_PATTERN_FMU_OK_TO_ARM 0x0003 |
slow blinking More... | |
#define | LED_PATTERN_FMU_REFUSE_TO_ARM 0x5555 |
fast blinking More... | |
#define | LED_PATTERN_IO_ARMED 0x5050 |
long off, then double blink More... | |
#define | LED_PATTERN_FMU_ARMED 0x5500 |
long off, then quad blink More... | |
#define | LED_PATTERN_IO_FMU_ARMED 0xffff |
constantly on More... | |
#define | ARM_COUNTER_THRESHOLD 10 |
Functions | |
static void | safety_check_button (void *arg) |
static void | failsafe_blink (void *arg) |
void | safety_init (void) |
Safety switch/LED. More... | |
void | failsafe_led_init (void) |
Variables | |
static struct hrt_call | arming_call |
static struct hrt_call | failsafe_call |
static unsigned | counter = 0 |
static unsigned | blink_counter = 0 |
static bool | safety_button_pressed |
Safety button logic.
Definition in file safety.c.
#define ARM_COUNTER_THRESHOLD 10 |
Definition at line 76 of file safety.c.
Referenced by safety_check_button().
#define LED_PATTERN_FMU_ARMED 0x5500 |
long off, then quad blink
Definition at line 64 of file safety.c.
Referenced by safety_check_button().
#define LED_PATTERN_FMU_OK_TO_ARM 0x0003 |
#define LED_PATTERN_FMU_REFUSE_TO_ARM 0x5555 |
#define LED_PATTERN_IO_ARMED 0x5050 |
long off, then double blink
Definition at line 63 of file safety.c.
Referenced by safety_check_button().
#define LED_PATTERN_IO_FMU_ARMED 0xffff |
|
static |
Definition at line 169 of file safety.c.
References LED_AMBER, PX4IO_P_STATUS_FLAGS_FMU_OK, PX4IO_P_STATUS_FLAGS_INIT_OK, and r_status_flags.
Referenced by failsafe_led_init().
void failsafe_led_init | ( | void | ) |
Definition at line 91 of file safety.c.
References failsafe_blink(), failsafe_call, and hrt_call_every().
Referenced by user_start().
|
static |
Definition at line 98 of file safety.c.
References ARM_COUNTER_THRESHOLD, atomic_modify_clear(), atomic_modify_or(), blink_counter, BUTTON_SAFETY, counter, LED_PATTERN_FMU_ARMED, LED_PATTERN_FMU_OK_TO_ARM, LED_PATTERN_FMU_REFUSE_TO_ARM, LED_PATTERN_IO_ARMED, LED_PATTERN_IO_FMU_ARMED, LED_SAFETY, PX4IO_P_SETUP_ARMING_FMU_ARMED, PX4IO_P_SETUP_ARMING_IO_ARM_OK, PX4IO_P_STATUS_FLAGS_SAFETY_OFF, r_setup_arming, r_status_flags, and safety_button_pressed.
Referenced by safety_init().
void safety_init | ( | void | ) |
Safety switch/LED.
Definition at line 84 of file safety.c.
References arming_call, hrt_call_every(), and safety_check_button().
Referenced by user_start().
|
static |
Definition at line 49 of file safety.c.
Referenced by safety_init().
|
static |
Definition at line 67 of file safety.c.
Referenced by safety_check_button().
|
static |
Definition at line 56 of file safety.c.
Referenced by Ekf::calculateOutputStates(), do_level_calibration(), LedController::get_control_data(), SRF02::init(), EstimatorInterface::isVehicleAtRest(), IridiumSBD::main_loop(), ring_blink(), Commander::run(), safety_check_button(), IridiumSBD::start(), rc_receiver::task_main(), test_corruption(), vmount_main(), px4::logger::watchdog_update(), RGBLED::~RGBLED(), RGBLED_NPC5623C::~RGBLED_NPC5623C(), RGBLED_PWM::~RGBLED_PWM(), and ToneAlarm::~ToneAlarm().
|
static |
Definition at line 50 of file safety.c.
Referenced by failsafe_led_init().
|
static |
Definition at line 78 of file safety.c.
Referenced by SafetyButton::CheckButton(), and safety_check_button().