Enabled bidirectional communication with NMEA GPS for all targets.
This commit is contained in:
parent
eab55fc3ee
commit
6a605be73b
|
@ -279,10 +279,10 @@ void gpsInit(void)
|
|||
}
|
||||
|
||||
portMode_e mode = MODE_RXTX;
|
||||
// only RX is needed for NMEA-style GPS
|
||||
#if !defined(COLIBRI_RACE) || !defined(LUX_RACE)
|
||||
if (gpsConfig()->provider == GPS_NMEA)
|
||||
#if defined(GPS_NMEA_TX_ONLY)
|
||||
if (gpsConfig()->provider == GPS_NMEA) {
|
||||
mode &= ~MODE_TX;
|
||||
}
|
||||
#endif
|
||||
|
||||
// no callback - buffer will be consumed in gpsUpdate()
|
||||
|
@ -299,15 +299,16 @@ void gpsInit(void)
|
|||
#ifdef USE_GPS_NMEA
|
||||
void gpsInitNmea(void)
|
||||
{
|
||||
#if defined(COLIBRI_RACE) || defined(LUX_RACE)
|
||||
#if !defined(GPS_NMEA_TX_ONLY)
|
||||
uint32_t now;
|
||||
#endif
|
||||
switch (gpsData.state) {
|
||||
case GPS_INITIALIZING:
|
||||
#if defined(COLIBRI_RACE) || defined(LUX_RACE)
|
||||
#if !defined(GPS_NMEA_TX_ONLY)
|
||||
now = millis();
|
||||
if (now - gpsData.state_ts < 1000)
|
||||
if (now - gpsData.state_ts < 1000) {
|
||||
return;
|
||||
}
|
||||
gpsData.state_ts = now;
|
||||
if (gpsData.state_position < 1) {
|
||||
serialSetBaudRate(gpsPort, 4800);
|
||||
|
@ -323,10 +324,11 @@ void gpsInitNmea(void)
|
|||
break;
|
||||
#endif
|
||||
case GPS_CHANGE_BAUD:
|
||||
#if defined(COLIBRI_RACE) || defined(LUX_RACE)
|
||||
#if !defined(GPS_NMEA_TX_ONLY)
|
||||
now = millis();
|
||||
if (now - gpsData.state_ts < 1000)
|
||||
if (now - gpsData.state_ts < 1000) {
|
||||
return;
|
||||
}
|
||||
gpsData.state_ts = now;
|
||||
if (gpsData.state_position < 1) {
|
||||
serialSetBaudRate(gpsPort, baudRates[gpsInitData[gpsData.baudrateIndex].baudrateIndex]);
|
||||
|
@ -334,14 +336,13 @@ void gpsInitNmea(void)
|
|||
} else if (gpsData.state_position < 2) {
|
||||
serialPrint(gpsPort, "$PSRF103,00,6,00,0*23\r\n");
|
||||
gpsData.state_position++;
|
||||
} else {
|
||||
} else
|
||||
#else
|
||||
serialSetBaudRate(gpsPort, baudRates[gpsInitData[gpsData.baudrateIndex].baudrateIndex]);
|
||||
#endif
|
||||
gpsSetState(GPS_RECEIVING_DATA);
|
||||
#if defined(COLIBRI_RACE) || defined(LUX_RACE)
|
||||
{
|
||||
serialSetBaudRate(gpsPort, baudRates[gpsInitData[gpsData.baudrateIndex].baudrateIndex]);
|
||||
}
|
||||
#endif
|
||||
gpsSetState(GPS_RECEIVING_DATA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue