aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-11-13 23:55:58 -0800
committerLorenz Meier <lm@inf.ethz.ch>2012-11-13 23:55:58 -0800
commit141dcef1248707e03fdf26e5165b145747645808 (patch)
tree749e2e8ec727443afbc2d193c07013876e8ce7a1
parenta6294be6f076913d7b2c04e42aae1c0c93193a6f (diff)
parented87f7d12c35868c72e081d40112625c95cd62fb (diff)
downloadpx4-firmware-141dcef1248707e03fdf26e5165b145747645808.tar.gz
px4-firmware-141dcef1248707e03fdf26e5165b145747645808.tar.bz2
px4-firmware-141dcef1248707e03fdf26e5165b145747645808.zip
Merge pull request #52 from dojomouse/master
GPS Status fixes
-rw-r--r--apps/gps/mtk.c7
-rw-r--r--apps/gps/ubx.c12
2 files changed, 7 insertions, 12 deletions
diff --git a/apps/gps/mtk.c b/apps/gps/mtk.c
index 604dba05c..7ba4f52b0 100644
--- a/apps/gps/mtk.c
+++ b/apps/gps/mtk.c
@@ -410,6 +410,8 @@ void *mtk_watchdog_loop(void *args)
} else {
/* gps healthy */
mtk_success_count++;
+ mtk_fail_count = 0;
+ once_ok = true; // XXX Should this be true on a single success, or on same criteria as mtk_healthy?
if (!mtk_healthy && mtk_success_count >= MTK_HEALTH_SUCCESS_COUNTER_LIMIT) {
printf("[gps] MTK module found, status ok (baud=%d)\r\n", current_gps_speed);
@@ -418,11 +420,8 @@ void *mtk_watchdog_loop(void *args)
mtk_gps->satellite_info_available = 0;
// global_data_send_subsystem_info(&mtk_present_enabled_healthy);
mavlink_log_info(mavlink_fd, "[gps] MTK custom binary module found, status ok\n");
+ mtk_healthy = true;
}
-
- mtk_healthy = true;
- mtk_fail_count = 0;
- once_ok = true;
}
usleep(MTK_WATCHDOG_WAIT_TIME_MICROSECONDS);
diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c
index 21e917bf8..2bbecb12e 100644
--- a/apps/gps/ubx.c
+++ b/apps/gps/ubx.c
@@ -786,22 +786,18 @@ void *ubx_watchdog_loop(void *args)
sleep(1);
} else {
+ /* gps healthy */
+ ubx_success_count++;
+ ubx_fail_count = 0;
+ once_ok = true; // XXX Should this be true on a single success, or on same criteria as ubx_healthy?
if (!ubx_healthy && ubx_success_count == UBX_HEALTH_SUCCESS_COUNTER_LIMIT) {
//printf("[gps] ublox UBX module status ok (baud=%d)\r\n", current_gps_speed);
// global_data_send_subsystem_info(&ubx_present_enabled_healthy);
mavlink_log_info(mavlink_fd, "[gps] UBX module found, status ok\n");
ubx_healthy = true;
- ubx_fail_count = 0;
- once_ok = true;
}
-
- /* gps healthy */
- ubx_success_count++;
- ubx_healthy = true;
- ubx_fail_count = 0;
}
-
usleep(UBX_WATCHDOG_WAIT_TIME_MICROSECONDS);
}