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)

This commit is contained in:
Julian Oes
2012-09-19 22:28:13 +02:00
parent 855fbe8543
commit f707a2ce60
6 changed files with 109 additions and 134 deletions
+3 -2
View File
@@ -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 */