gps subsystem: really need to define GPS_FIX_x in gps.h and convert all implementations to the same fix mask

airborne it would work, but GCS, etc. of course rely on 0->nofix 3->3d-fix in the messages
This commit is contained in:
Felix Ruess
2012-03-16 12:05:01 +01:00
parent fdacc93040
commit 09ea6f1b1f
9 changed files with 38 additions and 32 deletions
+4
View File
@@ -37,6 +37,10 @@
#include GPS_TYPE_H
#endif
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#define GpsFixValid() (gps.fix == GPS_FIX_3D)
+10 -1
View File
@@ -158,7 +158,16 @@ void gps_mtk_read_message(void) {
gps.speed_3d = gps.gspeed;
gps.course = (RadOfDeg(MTK_DIY14_NAV_Heading(gps_mtk.msg_buf)))*10;
gps.num_sv = MTK_DIY14_NAV_numSV(gps_mtk.msg_buf);
gps.fix = MTK_DIY14_NAV_GPSfix(gps_mtk.msg_buf);
switch (MTK_DIY14_NAV_GPSfix(gps_mtk.msg_buf)) {
case MTK_DIY_FIX_3D:
gps.fix = GPS_FIX_3D;
break;
case MTK_DIY_FIX_2D:
gps.fix = GPS_FIX_2D;
break;
default:
gps.fix = GPS_FIX_NONE;
}
gps.tow = MTK_DIY14_NAV_ITOW(gps_mtk.msg_buf);;
// FIXME: with MTK DIY 1.4 you do not receive GPS week
gps.week = 0;
+4 -4
View File
@@ -28,10 +28,6 @@
/** Includes macros generated from mtk.xml */
#include "mtk_protocol.h"
#define GPS_FIX_NONE 0x01
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#define GPS_MTK_MAX_PAYLOAD 255
struct GpsMtk {
@@ -109,6 +105,10 @@ extern bool_t gps_configuring;
extern void gps_mtk_read_message(void);
extern void gps_mtk_parse(uint8_t c);
#define MTK_DIY_FIX_3D 3
#define MTK_DIY_FIX_2D 2
#define MTK_DIY_FIX_NONE 1
/*
* dynamic GPS configuration
*/
+2 -6
View File
@@ -20,8 +20,8 @@
*
*/
/** @file gps_nmea.h
* NMEA protocol specific code
/** \file gps_nmea.h
* \brief NMEA protocol specific code
*
*/
@@ -33,10 +33,6 @@
#define GPS_NB_CHANNELS 16
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#ifdef DEBUG_NMEA
#define NMEA_PRINT(...) { UsbSPrintString( __VA_ARGS__);};
#else
-4
View File
@@ -3,10 +3,6 @@
#include "std.h"
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#define GPS_NB_CHANNELS 16
extern bool_t gps_available;
-4
View File
@@ -3,10 +3,6 @@
#include "nps_sensors.h"
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#define GPS_NB_CHANNELS 16
extern bool_t gps_available;
+18 -2
View File
@@ -20,6 +20,7 @@
*/
#include "subsystems/gps.h"
#include "led.h"
#if GPS_USE_LATLONG
/* currently needed to get nav_utm_zone0 */
@@ -40,8 +41,12 @@ struct GpsSkytraq gps_skytraq;
#define GOT_CHECKSUM 7
#define GOT_SYNC3 8
#define SKYTRAQ_FIX_NONE 0x00
#define SKYTRAQ_FIX_2D 0x01
#define SKYTRAQ_FIX_3D 0x02
#define SKYTRAQ_FIX_3D_DGPS 0x03
//#include "my_debug_servo.h"
#include "led.h"
void gps_impl_init(void) {
@@ -72,9 +77,20 @@ void gps_skytraq_read_message(void) {
// sacc;
// gps.pdop = SKYTRAQ_NAVIGATION_DATA_PDOP(gps_skytraq.msg_buf);
gps.num_sv = SKYTRAQ_NAVIGATION_DATA_NumSV(gps_skytraq.msg_buf);
gps.fix = SKYTRAQ_NAVIGATION_DATA_FixMode(gps_skytraq.msg_buf);
gps.tow = SKYTRAQ_NAVIGATION_DATA_TOW(gps_skytraq.msg_buf)/10;
switch (SKYTRAQ_NAVIGATION_DATA_FixMode(gps_skytraq.msg_buf)) {
case SKYTRAQ_FIX_3D_DGPS:
case SKYTRAQ_FIX_3D:
gps.fix = GPS_FIX_3D;
break;
case SKYTRAQ_FIX_2D:
gps.fix = GPS_FIX_2D;
break;
default:
gps.fix = GPS_FIX_NONE;
}
#if GPS_USE_LATLONG
/* Computes from (lat, long) in the referenced UTM zone */
struct LlaCoor_f lla_f;
-7
View File
@@ -24,13 +24,6 @@
#include "mcu_periph/uart.h"
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x01
#define GPS_FIX_3D 0x02
#define GPS_FIX_3D_DGPS 0x03
#define SKYTRAQ_SYNC1 0xA0
#define SKYTRAQ_SYNC2 0xA1
-4
View File
@@ -38,10 +38,6 @@
#define GPS_NB_CHANNELS 16
#define GPS_FIX_NONE 0x00
#define GPS_FIX_2D 0x02
#define GPS_FIX_3D 0x03
#define GPS_UBX_MAX_PAYLOAD 255
struct GpsUbx {
bool_t msg_available;