aboutsummaryrefslogtreecommitdiff
path: root/apps/gps
diff options
context:
space:
mode:
authorJulian Oes <joes@student.ethz.ch>2012-09-20 08:17:01 +0200
committerJulian Oes <joes@student.ethz.ch>2012-09-20 08:17:01 +0200
commit71b37a859c9f7bca5107aa224cfd2b11e08e191a (patch)
tree33c1e77a76e1c00c41f05c094715545b2cbacb46 /apps/gps
parentf707a2ce60ea0818f10900e467eef2505c0fc3ec (diff)
downloadpx4-firmware-71b37a859c9f7bca5107aa224cfd2b11e08e191a.tar.gz
px4-firmware-71b37a859c9f7bca5107aa224cfd2b11e08e191a.tar.bz2
px4-firmware-71b37a859c9f7bca5107aa224cfd2b11e08e191a.zip
the gps_thread_should_exit flag is now static again, hope it works like this
Diffstat (limited to 'apps/gps')
-rw-r--r--apps/gps/gps.c13
-rw-r--r--apps/gps/gps.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/apps/gps/gps.c b/apps/gps/gps.c
index 9b6249546..055b0138d 100644
--- a/apps/gps/gps.c
+++ b/apps/gps/gps.c
@@ -58,7 +58,6 @@
#include <v1.0/common/mavlink.h>
#include <mavlink/mavlink_log.h>
-bool gps_thread_should_exit = false; /**< Deamon exit flag */
static bool thread_running = false; /**< Deamon status flag */
static int deamon_task; /**< Handle of deamon task / thread */
@@ -154,7 +153,7 @@ int gps_main(int argc, char *argv[])
if (!strcmp(argv[1], "status")) {
if (thread_running) {
- printf("\gps is running\n");
+ printf("\tgps is running\n");
} else {
printf("\tgps not started\n");
}
@@ -329,7 +328,7 @@ int gps_thread_main(int argc, char *argv[]) {
* if the gps was once running the wtachdog thread will not return but instead try to reconfigure the gps (depending on the mode/protocol)
*/
- if (current_gps_mode == GPS_MODE_UBX) { //TODO: make a small enum with all modes to avoid all the strcpy
+ if (current_gps_mode == GPS_MODE_UBX) {
if (gps_verbose) printf("[gps] Trying UBX mode at %d baud\n", current_gps_speed);
@@ -465,11 +464,11 @@ int gps_thread_main(int argc, char *argv[]) {
/* exit quickly if stop command has been received */
if (gps_thread_should_exit) {
- printf("[gps] stopped, exiting.\n");
- close(mavlink_fd);
- thread_running = false;
+ printf("[gps] stopped, exiting.\n");
+ close(mavlink_fd);
+ thread_running = false;
return 0;
- }
+ }
/* if both, mode and baud is set by argument, we only need one loop*/
if (gps_mode_try_all == false && gps_baud_try_all == false)
diff --git a/apps/gps/gps.h b/apps/gps/gps.h
index 80d4c7e1d..0607e5796 100644
--- a/apps/gps/gps.h
+++ b/apps/gps/gps.h
@@ -10,6 +10,6 @@
#include <stdbool.h>
-extern bool gps_thread_should_exit; /**< Deamon status flag */
+static bool gps_thread_should_exit; /**< Deamon status flag */
#endif /* GPS_H_ */