Skip to content

Commit

Permalink
gps_ublox.c: For M10 to use Glonass & Beideo concurrentlky, use B1C
Browse files Browse the repository at this point in the history
  • Loading branch information
sensei-hacker committed Jan 15, 2024
1 parent 2713a8e commit af17e12
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/io/gps_ublox.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,10 @@ static void configureGNSS10(void)
{UBLOX_CFG_SIGNAL_GAL_E1_ENA, gpsState.gpsConfig->ubloxUseGalileo},

// Beidou
// M10 can't use BDS_B1I and Glonass together. Instead, use BDS_B1C
{UBLOX_CFG_SIGNAL_BDS_ENA, gpsState.gpsConfig->ubloxUseBeidou},
{UBLOX_CFG_SIGNAL_BDS_B1_ENA, gpsState.gpsConfig->ubloxUseBeidou},
{UBLOX_CFG_SIGNAL_BDS_B1C_ENA, 0},
{UBLOX_CFG_SIGNAL_BDS_B1_ENA, gpsState.gpsConfig->ubloxUseBeidou && ! gpsState.gpsConfig->ubloxUseGlonass},
{UBLOX_CFG_SIGNAL_BDS_B1C_ENA, gpsState.gpsConfig->ubloxUseBeidou && gpsState.gpsConfig->ubloxUseGlonass},

// Should be enabled with GPS
{UBLOX_CFG_QZSS_ENA, 1},
Expand Down Expand Up @@ -954,12 +955,18 @@ STATIC_PROTOTHREAD(gpsConfigure)

// Configure GNSS for M8N and later
if (gpsState.hwVersion >= UBX_HW_VERSION_UBLOX8) {
gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT);
if(gpsState.hwVersion >= UBX_HW_VERSION_UBLOX10 || (gpsState.swVersionMajor>=23 && gpsState.swVersionMinor >= 1)) {
gpsSetProtocolTimeout(GPS_SHORT_TIMEOUT);
bool use_VALSET = 0;
if ( (gpsState.swVersionMajor > 23) || (gpsState.swVersionMajor == 23 && gpsState.swVersionMinor > 1) ) {
use_VALSET = 1;
}

if ( use_VALSET && (gpsState.hwVersion >= UBX_HW_VERSION_UBLOX10) ) {
configureGNSS10();
} else {
} else {
configureGNSS();
}
}

ptWaitTimeout((_ack_state == UBX_ACK_GOT_ACK || _ack_state == UBX_ACK_GOT_NAK), GPS_CFG_CMD_TIMEOUT_MS);

if(_ack_state == UBX_ACK_GOT_NAK) {
Expand Down

0 comments on commit af17e12

Please sign in to comment.