@@ -1048,25 +1048,26 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread)
1048
1048
gpsState .hwVersion = UBX_HW_VERSION_UNKNOWN ;
1049
1049
gpsState .autoConfigStep = 0 ;
1050
1050
1051
- do {
1052
- pollVersion ();
1053
- gpsState .autoConfigStep ++ ;
1054
- ptWaitTimeout ((gpsState .hwVersion != UBX_HW_VERSION_UNKNOWN ), GPS_CFG_CMD_TIMEOUT_MS );
1055
- } while (gpsState .autoConfigStep < GPS_VERSION_RETRY_TIMES && gpsState .hwVersion == UBX_HW_VERSION_UNKNOWN );
1056
-
1057
- gpsState .autoConfigStep = 0 ;
1058
- ubx_capabilities .supported = ubx_capabilities .enabledGnss = ubx_capabilities .defaultGnss = 0 ;
1059
- // M7 and earlier will never get pass this step, so skip it (#9440).
1060
- // UBLOX documents that this is M8N and later
1061
- if (gpsState .hwVersion > UBX_HW_VERSION_UBLOX7 ) {
1062
- do {
1063
- pollGnssCapabilities ();
1064
- gpsState .autoConfigStep ++ ;
1065
- ptWaitTimeout ((ubx_capabilities .capMaxGnss != 0 ), GPS_CFG_CMD_TIMEOUT_MS );
1066
- } while (gpsState .autoConfigStep < GPS_VERSION_RETRY_TIMES && ubx_capabilities .capMaxGnss == 0 );
1067
- }
1068
1051
// Configure GPS module if enabled
1069
1052
if (gpsState .gpsConfig -> autoConfig ) {
1053
+ do {
1054
+ pollVersion ();
1055
+ gpsState .autoConfigStep ++ ;
1056
+ ptWaitTimeout ((gpsState .hwVersion != UBX_HW_VERSION_UNKNOWN ), GPS_CFG_CMD_TIMEOUT_MS );
1057
+ } while (gpsState .autoConfigStep < GPS_VERSION_RETRY_TIMES && gpsState .hwVersion == UBX_HW_VERSION_UNKNOWN );
1058
+
1059
+ gpsState .autoConfigStep = 0 ;
1060
+ ubx_capabilities .supported = ubx_capabilities .enabledGnss = ubx_capabilities .defaultGnss = 0 ;
1061
+ // M7 and earlier will never get pass this step, so skip it (#9440).
1062
+ // UBLOX documents that this is M8N and later
1063
+ if (gpsState .hwVersion > UBX_HW_VERSION_UBLOX7 ) {
1064
+ do {
1065
+ pollGnssCapabilities ();
1066
+ gpsState .autoConfigStep ++ ;
1067
+ ptWaitTimeout ((ubx_capabilities .capMaxGnss != 0 ), GPS_CFG_CMD_TIMEOUT_MS );
1068
+ } while (gpsState .autoConfigStep < GPS_VERSION_RETRY_TIMES && ubx_capabilities .capMaxGnss == 0 );
1069
+ }
1070
+
1070
1071
// Configure GPS
1071
1072
ptSpawn (gpsConfigure );
1072
1073
}
@@ -1079,7 +1080,7 @@ STATIC_PROTOTHREAD(gpsProtocolStateThread)
1079
1080
ptSemaphoreWait (semNewDataReady );
1080
1081
gpsProcessNewSolutionData (false);
1081
1082
1082
- if ((gpsState .gpsConfig -> provider == GPS_UBLOX || gpsState .gpsConfig -> provider == GPS_UBLOX7PLUS )) {
1083
+ if ((gpsState .gpsConfig -> autoConfig ) && ( gpsState . gpsConfig -> provider == GPS_UBLOX || gpsState .gpsConfig -> provider == GPS_UBLOX7PLUS )) {
1083
1084
if ((millis () - gpsState .lastCapaPoolMs ) > GPS_CAPA_INTERVAL ) {
1084
1085
gpsState .lastCapaPoolMs = millis ();
1085
1086
0 commit comments