diff options
author | Julian Oes <joes@student.ethz.ch> | 2012-09-19 22:28:13 +0200 |
---|---|---|
committer | Julian Oes <joes@student.ethz.ch> | 2012-09-19 22:28:13 +0200 |
commit | f707a2ce60ea0818f10900e467eef2505c0fc3ec (patch) | |
tree | 7bcd6c58cf79230c10014b17971efc575b3e7a69 /apps/gps/mtk.c | |
parent | 855fbe854372819f7a67225f932bb6fd673ef655 (diff) | |
download | px4-firmware-f707a2ce60ea0818f10900e467eef2505c0fc3ec.tar.gz px4-firmware-f707a2ce60ea0818f10900e467eef2505c0fc3ec.tar.bz2 px4-firmware-f707a2ce60ea0818f10900e467eef2505c0fc3ec.zip |
fixed stacktrace which happened in configure_gps_ubx(int *fd) because of faulty file descriptor argument, added possibility to stop gps daemon (only tested without gps attached)
Diffstat (limited to 'apps/gps/mtk.c')
-rw-r--r-- | apps/gps/mtk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/gps/mtk.c b/apps/gps/mtk.c index 290fa6129..e00b863b0 100644 --- a/apps/gps/mtk.c +++ b/apps/gps/mtk.c @@ -35,6 +35,7 @@ /* @file MTK custom binary (3DR) protocol implementation */ +#include "gps.h" #include "mtk.h" #include <nuttx/config.h> #include <unistd.h> @@ -313,7 +314,7 @@ void *mtk_loop(void *arg) mtk_gps = &mtk_gps_d; orb_advert_t gps_handle = orb_advertise(ORB_ID(vehicle_gps_position), mtk_gps); - while (1) { + while (!gps_thread_should_exit) { /* Parse a message from the gps receiver */ if (OK == read_gps_mtk(fd, gps_rx_buffer, MTK_BUFFER_SIZE)) { @@ -349,7 +350,7 @@ void *mtk_watchdog_loop(void *arg) int mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); - while (1) { + while (!gps_thread_should_exit) { fflush(stdout); /* if we have no update for a long time reconfigure gps */ |