Navigator: Only indicate timeout if we really time out

This commit is contained in:
Lorenz Meier 2015-11-02 13:48:30 +01:00
parent 4c60f4d98a
commit 4fa0123652

View File

@ -314,6 +314,8 @@ Navigator::task_main()
fds[0].fd = _global_pos_sub;
fds[0].events = POLLIN;
bool global_pos_available_once = false;
while (!_task_should_exit) {
/* wait for up to 200ms for data */
@ -321,7 +323,9 @@ Navigator::task_main()
if (pret == 0) {
/* timed out - periodic check for _task_should_exit, etc. */
PX4_WARN("navigator timed out");
if (global_pos_available_once) {
PX4_WARN("navigator timed out");
}
continue;
} else if (pret < 0) {
@ -330,6 +334,8 @@ Navigator::task_main()
continue;
}
global_pos_available_once = true;
perf_begin(_loop_perf);
if (_mavlink_fd < 0 && hrt_absolute_time() > mavlink_open_time) {