aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-07-30 11:28:30 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-07-30 11:28:30 +0200
commit1543c990031941cde44c9674cdcc571de53162f5 (patch)
treea8c2be9c0d4476c3a4b327071d6fb44269c4cd06 /src/modules
parent57cbf724f159cec88b21281a4ace415276df3a38 (diff)
parentd14891554e269714834360eb52242f8d66e1e6f9 (diff)
downloadpx4-firmware-1543c990031941cde44c9674cdcc571de53162f5.tar.gz
px4-firmware-1543c990031941cde44c9674cdcc571de53162f5.tar.bz2
px4-firmware-1543c990031941cde44c9674cdcc571de53162f5.zip
Merge branch 'master' of github.com:PX4/Firmware into fmuv2_bringup
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/commander/commander.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/commander/commander.c b/src/modules/commander/commander.c
index 8e5e36712..e9d1f3954 100644
--- a/src/modules/commander/commander.c
+++ b/src/modules/commander/commander.c
@@ -587,6 +587,8 @@ void do_gyro_calibration(int status_pub, struct vehicle_status_s *status)
close(fd);
+ int errcount = 0;
+
while (calibration_counter < calibration_count) {
/* wait blocking for new data */
@@ -602,8 +604,12 @@ void do_gyro_calibration(int status_pub, struct vehicle_status_s *status)
calibration_counter++;
} else if (poll_ret == 0) {
- /* any poll failure for 1s is a reason to abort */
- mavlink_log_info(mavlink_fd, "gyro calibration aborted, retry");
+ errcount++;
+ }
+
+ if (errcount > 1000) {
+ /* any persisting poll error is a reason to abort */
+ mavlink_log_info(mavlink_fd, "permanent gyro error, aborted.");
return;
}
}