diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-13 10:23:02 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-13 10:23:02 +0100 |
commit | 03076a72ca75917cf62d7889c6c6d0de36866b04 (patch) | |
tree | cd47c9885bfe7e7c80bd616a612db2a5f8ae564c /apps/px4io/safety.c | |
parent | 154035279fbfbe14be208d5ec957089f11f6447d (diff) | |
download | px4-firmware-03076a72ca75917cf62d7889c6c6d0de36866b04.tar.gz px4-firmware-03076a72ca75917cf62d7889c6c6d0de36866b04.tar.bz2 px4-firmware-03076a72ca75917cf62d7889c6c6d0de36866b04.zip |
Added required additional fields: If system is ok to launch (required for LED indicator), if system is ok to override fully by RC (required for multirotors which should not support this), desired PWM output rate in Hz (again required for some multirotors).
Diffstat (limited to 'apps/px4io/safety.c')
-rw-r--r-- | apps/px4io/safety.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/px4io/safety.c b/apps/px4io/safety.c index 60d20905a..52facfb61 100644 --- a/apps/px4io/safety.c +++ b/apps/px4io/safety.c @@ -63,10 +63,11 @@ static unsigned counter; /* * Define the various LED flash sequences for each system state. */ -#define LED_PATTERN_SAFE 0xffff // always on -#define LED_PATTERN_FMU_ARMED 0x4444 // slow blinking -#define LED_PATTERN_IO_ARMED 0x5555 // fast blinking -#define LED_PATTERN_IO_FMU_ARMED 0x5050 // long off then double blink +#define LED_PATTERN_SAFE 0xffff /**< always on */ +#define LED_PATTERN_VECTOR_FLIGHT_MODE_OK 0x3000 /**< always on with short break */ +#define LED_PATTERN_FMU_ARMED 0x4444 /**< slow blinking */ +#define LED_PATTERN_IO_ARMED 0x5555 /**< fast blinking */ +#define LED_PATTERN_IO_FMU_ARMED 0x5050 /**< long off then double blink */ static unsigned blink_counter = 0; @@ -139,6 +140,8 @@ safety_check_button(void *arg) } } else if (system_state.arm_ok) { pattern = LED_PATTERN_FMU_ARMED; + } else if (system_state.vector_flight_mode_ok) { + pattern = LED_PATTERN_VECTOR_FLIGHT_MODE_OK; } /* Turn the LED on if we have a 1 at the current bit position */ @@ -165,7 +168,7 @@ failsafe_blink(void *arg) static bool failsafe = false; /* blink the failsafe LED if we don't have FMU input */ - if (!system_state.mixer_use_fmu) { + if (!system_state.mixer_fmu_available) { failsafe = !failsafe; } else { failsafe = false; |