diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-10-30 15:27:48 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2013-11-30 20:18:27 +1100 |
commit | d0507296c0ce2f3614462a10f7b72d2d9fa5d8f6 (patch) | |
tree | 01ed61711b951fb97b1ee31e890d342f1e0aa5e0 /src/modules/px4iofirmware/px4io.c | |
parent | af47a3d795c01efbaabd60d6a15d48337187d35b (diff) | |
download | px4-firmware-d0507296c0ce2f3614462a10f7b72d2d9fa5d8f6.tar.gz px4-firmware-d0507296c0ce2f3614462a10f7b72d2d9fa5d8f6.tar.bz2 px4-firmware-d0507296c0ce2f3614462a10f7b72d2d9fa5d8f6.zip |
px4io: moved blue heartbeat LED to main loop
this allows us to tell if the main loop is running by looking for a
blinking blue LED
Diffstat (limited to 'src/modules/px4iofirmware/px4io.c')
-rw-r--r-- | src/modules/px4iofirmware/px4io.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index ff9eecd74..cd9bd197b 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -117,6 +117,13 @@ show_debug_messages(void) } } +static void +heartbeat_blink(void) +{ + static bool heartbeat = false; + LED_BLUE(heartbeat = !heartbeat); +} + int user_start(int argc, char *argv[]) { @@ -201,6 +208,7 @@ user_start(int argc, char *argv[]) */ uint64_t last_debug_time = 0; + uint64_t last_heartbeat_time = 0; for (;;) { /* track the rate at which the loop is running */ @@ -216,6 +224,11 @@ user_start(int argc, char *argv[]) controls_tick(); perf_end(controls_perf); + if ((hrt_absolute_time() - last_heartbeat_time) > 250*1000) { + last_heartbeat_time = hrt_absolute_time(); + heartbeat_blink(); + } + #if 0 /* check for debug activity */ show_debug_messages(); |