mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 18:07:25 +08:00
U-Center now also works fine on other ports than UBLOX_UART1
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Automatically configure any Ublox GPS for paparazzi
|
||||
|
||||
-configures all the messages, and the rates
|
||||
-automatic baudrate detection
|
||||
|
||||
Warning: you still need to tell the driver
|
||||
a) which paparazzi uart you use
|
||||
b) inside the ublox gps there are also many ports. the tiny/ppzgps use ublox_internal_port1 but if for instance you use a LS-SAM or I2C device you need to configure:
|
||||
|
||||
<define name="GPS_PORT_ID" value="GPS_PORT_UART2" />
|
||||
|
||||
-->
|
||||
|
||||
<module name="gps_ubx" dir="gps">
|
||||
<header>
|
||||
<file name="gps_ubx_ucenter.h"/>
|
||||
|
||||
@@ -304,6 +304,20 @@ static inline void gps_ubx_ucenter_config_sbas(void)
|
||||
//UbxSend_CFG_SBAS(0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
}
|
||||
|
||||
static inline void gps_ubx_ucenter_enable_msg(uint8_t class, uint8_t id, uint8_t rate)
|
||||
{
|
||||
#if GPS_PORT_ID == GPS_PORT_UART1
|
||||
UbxSend_CFG_MSG(class, id, 0, rate, 0, 0);
|
||||
#endif
|
||||
#if GPS_PORT_ID == GPS_PORT_UART2
|
||||
UbxSend_CFG_MSG(class, id, 0, 0, rate, 0);
|
||||
#endif
|
||||
#if GPS_PORT_ID == GPS_PORT_DDC
|
||||
UbxSend_CFG_MSG(class, id, rate, 0, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Text Telemetry for Debugging
|
||||
#ifndef DOWNLINK_DEVICE
|
||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
||||
@@ -353,23 +367,23 @@ static bool_t gps_ubx_ucenter_configure(uint8_t nr)
|
||||
gps_ubx_ucenter_config_nav();
|
||||
break;
|
||||
case 7:
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_POSLLH_ID, 0, 1, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_POSLLH_ID,1);
|
||||
break;
|
||||
case 8:
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_VELNED_ID, 0, 1, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_VELNED_ID, 1);
|
||||
break;
|
||||
case 9:
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_STATUS_ID, 0, 1, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_STATUS_ID, 1);
|
||||
break;
|
||||
case 10:
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_SVINFO_ID, 0, 4, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_SVINFO_ID, 4);
|
||||
break;
|
||||
case 11:
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_SOL_ID, 0, 8, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_SOL_ID, 8);
|
||||
break;
|
||||
case 12:
|
||||
// Disable UTM on old Lea4P
|
||||
UbxSend_CFG_MSG(UBX_NAV_ID, UBX_NAV_POSUTM_ID, 0, 0, 0, 0);
|
||||
gps_ubx_ucenter_enable_msg(UBX_NAV_ID, UBX_NAV_POSUTM_ID, 0);
|
||||
break;
|
||||
case 13:
|
||||
gps_ubx_ucenter_config_sbas();
|
||||
|
||||
Reference in New Issue
Block a user