41 #include <px4_platform_common/px4_config.h> 61 #define LED_PATTERN_FMU_OK_TO_ARM 0x0003 62 #define LED_PATTERN_FMU_REFUSE_TO_ARM 0x5555 63 #define LED_PATTERN_IO_ARMED 0x5050 64 #define LED_PATTERN_FMU_ARMED 0x5500 65 #define LED_PATTERN_IO_FMU_ARMED 0xffff 76 #define ARM_COUNTER_THRESHOLD 10 177 static bool failsafe =
false;
181 failsafe = !failsafe;
#define PX4IO_P_STATUS_FLAGS_FMU_OK
#define LED_PATTERN_FMU_REFUSE_TO_ARM
fast blinking
static void failsafe_blink(void *arg)
void failsafe_led_init(void)
High-resolution timer with callouts and timekeeping.
void atomic_modify_clear(volatile uint16_t *target, uint16_t modification)
#define LED_PATTERN_FMU_ARMED
long off, then quad blink
#define LED_PATTERN_IO_ARMED
long off, then double blink
#define ARM_COUNTER_THRESHOLD
static void safety_check_button(void *arg)
#define PX4IO_P_SETUP_ARMING_IO_ARM_OK
void atomic_modify_or(volatile uint16_t *target, uint16_t modification)
#define LED_PATTERN_FMU_OK_TO_ARM
slow blinking
static struct hrt_call arming_call
static struct hrt_call failsafe_call
__EXPORT void hrt_call_every(struct hrt_call *entry, hrt_abstime delay, hrt_abstime interval, hrt_callout callout, void *arg)
Call callout(arg) after delay, and then after every interval.
static unsigned blink_counter
#define PX4IO_P_STATUS_FLAGS_SAFETY_OFF
General defines and structures for the PX4IO module firmware.
void safety_init(void)
Safety switch/LED.
#define PX4IO_P_SETUP_ARMING_FMU_ARMED
#define PX4IO_P_STATUS_FLAGS_INIT_OK
#define LED_PATTERN_IO_FMU_ARMED
constantly on
static bool safety_button_pressed