aboutsummaryrefslogtreecommitdiff
path: root/src/modules/px4iofirmware/px4io.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-11-16 01:21:47 +0100
committerLorenz Meier <lm@inf.ethz.ch>2014-11-16 01:21:47 +0100
commit8caada2188b9c9a8fcab70fbad92ab14506c2427 (patch)
treeb9794f58fadcc7352f8575e5dd1e606cc4beb111 /src/modules/px4iofirmware/px4io.c
parent8583cf4dcc0e88842cdf717de26a4f0daa63729a (diff)
downloadpx4-firmware-8caada2188b9c9a8fcab70fbad92ab14506c2427.tar.gz
px4-firmware-8caada2188b9c9a8fcab70fbad92ab14506c2427.tar.bz2
px4-firmware-8caada2188b9c9a8fcab70fbad92ab14506c2427.zip
Breathe animation, led solid on arming
Diffstat (limited to 'src/modules/px4iofirmware/px4io.c')
-rw-r--r--src/modules/px4iofirmware/px4io.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c
index 349aaac57..14ee9cb40 100644
--- a/src/modules/px4iofirmware/px4io.c
+++ b/src/modules/px4iofirmware/px4io.c
@@ -134,6 +134,12 @@ ring_blink(void)
{
#ifdef GPIO_LED4
+ if (/* IO armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF)
+ /* and FMU is armed */ && (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED)) {
+ LED_RING(1);
+ return;
+ }
+
// XXX this led code does have
// intentionally a few magic numbers.
const unsigned max_brightness = 118;
@@ -147,7 +153,11 @@ ring_blink(void)
bool on = ((on_counter * 100) / brightness_counter+1) <= ((brightness * 100) / max_brightness+1);
- LED_RING(on);
+ // XXX once led is PWM driven,
+ // remove the ! in the line below
+ // to return to the proper breathe
+ // animation / pattern (currently inverted)
+ LED_RING(!on);
brightness_counter++;
if (on) {
@@ -349,7 +359,7 @@ user_start(int argc, char *argv[])
heartbeat_blink();
}
- ring_blink();
+ ring_blink();
check_reboot();