Skip to content

Commit 10620cb

Browse files
committed
More refactoring...
1 parent 4557835 commit 10620cb

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

Firmware/RTK_Surveyor/Rover.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool configureUbloxModuleRover()
3535
//RTCM is only available on ZED-F9P modules
3636
if (zedModuleType == PLATFORM_F9P)
3737
{
38-
//Disable RTCM sentences from being generated on I2C / SPI, USB, and UART2
38+
//Disable RTCM sentences from being generated on I2C, USB, and UART2. (Don't disable on UART1.)
3939
if (USE_I2C_GNSS)
4040
{
4141
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 0);

Firmware/RTK_Surveyor/System.ino

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)