aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-08-25 23:17:56 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-08-25 23:17:56 +0200
commit8a9da209d194b4f35000935379901ed6091091f9 (patch)
treeba7dd0f43e9ff9b1d7278a00c696288320ce49c9 /src/modules
parentd1a183b7f7dd6637aa766f9d2978ca96bec2c166 (diff)
downloadpx4-firmware-8a9da209d194b4f35000935379901ed6091091f9.tar.gz
px4-firmware-8a9da209d194b4f35000935379901ed6091091f9.tar.bz2
px4-firmware-8a9da209d194b4f35000935379901ed6091091f9.zip
limit warnx output on flight termination
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/commander/commander.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp
index 2fcf7bebb..8b065560f 100644
--- a/src/modules/commander/commander.cpp
+++ b/src/modules/commander/commander.cpp
@@ -1610,7 +1610,11 @@ int commander_thread_main(int argc, char *argv[])
(status.data_link_lost_cmd && status.gps_failure_cmd)) {
armed.force_failsafe = true;
status_changed = true;
- warnx("Flight termination because of data link loss && gps failure");
+ static bool flight_termination_printed = false;
+ if (!flight_termination_printed) {
+ warnx("Flight termination because of data link loss && gps failure");
+ flight_termination_printed = true;
+ }
mavlink_log_critical(mavlink_fd, "DL and GPS lost: flight termination");
}
@@ -1625,7 +1629,11 @@ int commander_thread_main(int argc, char *argv[])
(status.rc_signal_lost_cmd && status.gps_failure_cmd))) {
armed.force_failsafe = true;
status_changed = true;
- warnx("Flight termination because of RC signal loss && gps failure");
+ static bool flight_termination_printed = false;
+ if (!flight_termination_printed) {
+ warnx("Flight termination because of RC signal loss && gps failure");
+ flight_termination_printed = true;
+ }
mavlink_log_critical(mavlink_fd, "RC and GPS lost: flight termination");
}
}