@@ -7,6 +7,12 @@ bool configureUbloxModule()
77
88 bool response = true ;
99
10+ // Turn on/off debug messages
11+ if (settings.enableI2Cdebug )
12+ theGNSS.enableDebugging (Serial, true ); // Enable only the critical debug messages over Serial
13+ else
14+ theGNSS.disableDebugging ();
15+
1016 // Wait for initial report from module
1117 int maxWait = 2000 ;
1218 startTime = millis ();
@@ -166,7 +172,6 @@ bool configureUbloxModule()
166172 // Disable NMEA messages on all but UART1
167173 response &= theGNSS.newCfgValset ();
168174
169- // TODO: check if we should use "if (USE_I2C_GNSS)" here
170175 response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GGA_I2C, 0 );
171176 response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSA_I2C, 0 );
172177 response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSV_I2C, 0 );
@@ -183,13 +188,17 @@ bool configureUbloxModule()
183188 response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GLL_UART2, 0 );
184189 response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_VTG_UART2, 0 );
185190
186- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GGA_SPI, 0 );
187- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSA_SPI, 0 );
188- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSV_SPI, 0 );
189- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_RMC_SPI, 0 );
190- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GST_SPI, 0 );
191- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GLL_SPI, 0 );
192- response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_VTG_SPI, 0 );
191+ if (USE_I2C_GNSS) // Don't disable NMEA on SPI if the GNSS is SPI!
192+ {
193+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GGA_SPI, 0 );
194+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSA_SPI, 0 );
195+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GSV_SPI, 0 );
196+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_RMC_SPI, 0 );
197+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GST_SPI, 0 );
198+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_GLL_SPI, 0 );
199+ response &= theGNSS.addCfgValset (UBLOX_CFG_MSGOUT_NMEA_ID_VTG_SPI, 0 );
200+ }
201+
193202 response &= theGNSS.sendCfgValset ();
194203
195204 if (response == false )
@@ -200,12 +209,6 @@ bool configureUbloxModule()
200209 if (zedModuleType == PLATFORM_F9R)
201210 response &= theGNSS.setAutoESFSTATUS (true , false ); // Tell the GPS to "send" each ESF Status, but do not update stale data when accessed
202211
203- // Turn on/off debug messages
204- if (settings.enableI2Cdebug )
205- theGNSS.enableDebugging (Serial, true ); // Enable only the critical debug messages over Serial
206- else
207- theGNSS.disableDebugging ();
208-
209212 return (response);
210213}
211214
@@ -557,7 +560,9 @@ bool setMessages()
557560 }
558561
559562 theGNSS.setRTCMLoggingMask (logRTCMMessages);
563+ log_d (" setRTCMLoggingMask 0x%X" , logRTCMMessages);
560564 theGNSS.setNMEALoggingMask (logNMEAMessages);
565+ log_d (" setNMEALoggingMask 0x%X" , logNMEAMessages);
561566
562567 log_d (" logging config complete" );
563568 }
0 commit comments