Skip to content

Commit

Permalink
[gps_bebop] only enable NMEA on bebop since some modules only provide…
Browse files Browse the repository at this point in the history
… nmea after firmware updates
  • Loading branch information
dewagter authored and mavlab-field committed Oct 23, 2016
1 parent 9956f97 commit d587e10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions conf/modules/gps_ubx_ucenter.xml
Expand Up @@ -17,6 +17,7 @@ Warning: you still need to tell the driver, which paparazzi port you use.
value="NAV5_DYN_PORTABLE|NAV5_DYN_FIXED|NAV5_DYN_STATIONARY|NAV5_DYN_PEDESTRIAN|NAV5_DYN_AUTOMOTIVE|NAV5_DYN_SEA|NAV5_DYN_AIRBORNE_1G|NAV5_DYN_AIRBORNE_2G|NAV5_DYN_AIRBORNE_4G"
description="Dynamic model used by ublox GPS filter. Default:NAV5_DYN_AIRBORNE_2G"/>
<define name="USE_GPS_UBX_RXM_RAW" description="Activate raw measurments (only available on U-Blox T versions)"/>
<define name="GPS_UBX_ENABLE_NMEA_DATA_MASK" value="0x00|0xff" description="NMEA is disabled by default (0x00). To enable NMEA and UBX, set MASK to 0xff."/>
</doc>

<settings>
Expand Down
1 change: 1 addition & 0 deletions sw/airborne/boards/bebop.h
Expand Up @@ -82,6 +82,7 @@

/** uart connected to GPS internally */
#define UART1_DEV /dev/ttyPA1
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0xff
/** FTDI cable for stereoboard or external GPS */
#define UART2_DEV /dev/ttyUSB0

Expand Down
10 changes: 7 additions & 3 deletions sw/airborne/modules/gps/gps_ubx_ucenter.c
Expand Up @@ -31,9 +31,9 @@
#include "subsystems/gps/gps_ubx.h"
#include "ubx_protocol.h"
#include "subsystems/datalink/downlink.h"
#include <stdio.h>

#if PRINT_DEBUG_GPS_UBX_UCENTER
#include <stdio.h>
#define DEBUG_PRINT(...) printf(__VA_ARGS__)
#else
#define DEBUG_PRINT(...) {}
Expand Down Expand Up @@ -347,6 +347,10 @@ static bool gps_ubx_ucenter_autobaud(uint8_t nr)
#define GPS_UBX_NAV5_DYNAMICS NAV5_DYN_AIRBORNE_2G
#endif

#ifndef GPS_UBX_ENABLE_NMEA_DATA_MASK
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0x00
#endif

#define NAV5_MASK 0x05 // Apply dynamic model and position fix mode settings

#define NAV5_2D_ONLY 1
Expand Down Expand Up @@ -425,13 +429,13 @@ static inline void gps_ubx_ucenter_config_port(void)
UbxSend_CFG_PRT(gps_ubx_ucenter.dev,
gps_ubx_ucenter.port_id, 0x0, 0x0,
UBX_UART_MODE_MASK, UART_SPEED(gps_ubx_ucenter.baud_target), UBX_PROTO_MASK | NMEA_PROTO_MASK,
UBX_PROTO_MASK| NMEA_PROTO_MASK, 0x0, 0x0);
UBX_PROTO_MASK | (NMEA_PROTO_MASK & GPS_UBX_ENABLE_NMEA_DATA_MASK), 0x0, 0x0);
break;
// USB Interface
case GPS_PORT_USB:
UbxSend_CFG_PRT(gps_ubx_ucenter.dev,
gps_ubx_ucenter.port_id, 0x0, 0x0, 0x0, 0x0,
UBX_PROTO_MASK | NMEA_PROTO_MASK, UBX_PROTO_MASK| NMEA_PROTO_MASK, 0x0, 0x0);
UBX_PROTO_MASK | NMEA_PROTO_MASK, UBX_PROTO_MASK| (NMEA_PROTO_MASK & GPS_UBX_ENABLE_NMEA_DATA_MASK), 0x0, 0x0);
break;
case GPS_PORT_SPI:
DEBUG_PRINT("WARNING: ublox SPI port is currently not supported.\n");
Expand Down

0 comments on commit d587e10

Please sign in to comment.