diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-30 11:03:45 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-30 11:03:45 +0200 |
commit | d14891554e269714834360eb52242f8d66e1e6f9 (patch) | |
tree | dd9d4d20f541faa3be6220d18d47bb5a147f3661 /src/modules | |
parent | dad76c56c63a358ec2c4ea2248ef617843b48bab (diff) | |
parent | db527ee88139ef470007f82675b57ec313cdc495 (diff) | |
download | px4-firmware-d14891554e269714834360eb52242f8d66e1e6f9.tar.gz px4-firmware-d14891554e269714834360eb52242f8d66e1e6f9.tar.bz2 px4-firmware-d14891554e269714834360eb52242f8d66e1e6f9.zip |
Merge branch 'config' of github.com:PX4/Firmware
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/commander/commander.c | 10 |
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; } } |