Fix error reporting logic

This commit is contained in:
Lorenz Meier
2015-11-19 17:48:39 +01:00
parent 173edcef63
commit f2b988dcaa
3 changed files with 15 additions and 14 deletions
+3 -7
View File
@@ -2195,9 +2195,9 @@ int commander_thread_main(int argc, char *argv[])
/* report a regain */
if (telemetry_last_dl_loss[i] > 0) {
mavlink_and_console_log_info(mavlink_fd, "data link #%i regained", i);
} else if (telemetry_last_dl_loss[i] == 0){
/* do not report a new data link in order to not spam the user */
status.data_link_found_new = true;
} else if (telemetry_last_dl_loss[i] == 0) {
/* new link */
status.condition_system_prearm_error_reported = false;
status_changed = true;
}
@@ -2208,10 +2208,6 @@ int commander_thread_main(int argc, char *argv[])
/* telemetry was healthy also in last iteration
* we don't have to check a timeout */
have_link = true;
if(status.data_link_found_new) {
status.data_link_found_new = false;
status_changed = true;
}
}
} else {