mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Merge pull request #3993 from iNavFlight/de_gps_autoconfig_fix
Fix always-on GPS autoconfig
This commit is contained in:
commit
d9fa9097c7
2 changed files with 43 additions and 38 deletions
|
@ -329,6 +329,7 @@ STATIC_PROTOTHREAD(gpsProtocolStateThreadMTK)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send configuration commands
|
// Send configuration commands
|
||||||
|
if (gpsState.gpsConfig->autoConfig) {
|
||||||
// Disable all messages except GGA and RMC
|
// Disable all messages except GGA and RMC
|
||||||
serialPrint(gpsState.gpsPort, "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n");
|
serialPrint(gpsState.gpsPort, "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n");
|
||||||
ptWait(isSerialTransmitBufferEmpty(gpsState.gpsPort));
|
ptWait(isSerialTransmitBufferEmpty(gpsState.gpsPort));
|
||||||
|
@ -360,6 +361,7 @@ STATIC_PROTOTHREAD(gpsProtocolStateThreadMTK)
|
||||||
// Try set 10Hz update rate. Module will ignore it if can't support
|
// Try set 10Hz update rate. Module will ignore it if can't support
|
||||||
serialPrint(gpsState.gpsPort, "$PMTK220,100*2F\r\n");
|
serialPrint(gpsState.gpsPort, "$PMTK220,100*2F\r\n");
|
||||||
ptWait(isSerialTransmitBufferEmpty(gpsState.gpsPort));
|
ptWait(isSerialTransmitBufferEmpty(gpsState.gpsPort));
|
||||||
|
}
|
||||||
|
|
||||||
// Reset protocol timeout
|
// Reset protocol timeout
|
||||||
gpsSetProtocolTimeout(GPS_TIMEOUT);
|
gpsSetProtocolTimeout(GPS_TIMEOUT);
|
||||||
|
|
|
@ -865,6 +865,8 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread)
|
||||||
serialSetBaudRate(gpsState.gpsPort, baudRates[gpsToSerialBaudRate[gpsState.baudrateIndex]]);
|
serialSetBaudRate(gpsState.gpsPort, baudRates[gpsToSerialBaudRate[gpsState.baudrateIndex]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configure GPS module if enabled
|
||||||
|
if (gpsState.gpsConfig->autoConfig) {
|
||||||
// Reset protocol timeout
|
// Reset protocol timeout
|
||||||
gpsSetProtocolTimeout(MIN(GPS_TIMEOUT, ((GPS_VERSION_RETRY_TIMES + 1) * GPS_VERSION_DETECTION_TIMEOUT_MS)));
|
gpsSetProtocolTimeout(MIN(GPS_TIMEOUT, ((GPS_VERSION_RETRY_TIMES + 1) * GPS_VERSION_DETECTION_TIMEOUT_MS)));
|
||||||
|
|
||||||
|
@ -880,6 +882,7 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread)
|
||||||
|
|
||||||
// Configure GPS
|
// Configure GPS
|
||||||
ptSpawn(gpsConfigure);
|
ptSpawn(gpsConfigure);
|
||||||
|
}
|
||||||
|
|
||||||
// GPS setup done, reset timeout
|
// GPS setup done, reset timeout
|
||||||
gpsSetProtocolTimeout(GPS_TIMEOUT);
|
gpsSetProtocolTimeout(GPS_TIMEOUT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue