@@ -144,19 +144,38 @@ bool configureUbloxModule()
144
144
}
145
145
}
146
146
147
- // The USB port on the ZED may be used for RTCM to/from the computer (as an NTRIP caster or client)
148
- // So let's be sure all protocols are on for the USB port
149
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_UBX, 1 );
150
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_NMEA, 1 );
151
- if (commandSupported (UBLOX_CFG_USBOUTPROT_RTCM3X) == true )
152
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_RTCM3X, 1 );
153
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_UBX, 1 );
154
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_NMEA, 1 );
155
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_RTCM3X, 1 );
156
- if (commandSupported (UBLOX_CFG_USBINPROT_SPARTN) == true )
147
+ if (settings.enableZedUsb == true )
157
148
{
158
- // See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/713
159
- response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_SPARTN, 1 );
149
+ // The USB port on the ZED may be used for RTCM to/from the computer (as an NTRIP caster or client)
150
+ // So let's be sure all protocols are on for the USB port
151
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_UBX, 1 );
152
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_NMEA, 1 );
153
+ if (commandSupported (UBLOX_CFG_USBOUTPROT_RTCM3X) == true )
154
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_RTCM3X, 1 );
155
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_UBX, 1 );
156
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_NMEA, 1 );
157
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_RTCM3X, 1 );
158
+ if (commandSupported (UBLOX_CFG_USBINPROT_SPARTN) == true )
159
+ {
160
+ // See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/713
161
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_SPARTN, 1 );
162
+ }
163
+ }
164
+ else
165
+ {
166
+ // Disable all protocols over USB
167
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_UBX, 0 );
168
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_NMEA, 0 );
169
+ if (commandSupported (UBLOX_CFG_USBOUTPROT_RTCM3X) == true )
170
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBOUTPROT_RTCM3X, 0 );
171
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_UBX, 0 );
172
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_NMEA, 0 );
173
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_RTCM3X, 0 );
174
+ if (commandSupported (UBLOX_CFG_USBINPROT_SPARTN) == true )
175
+ {
176
+ // See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/713
177
+ response &= theGNSS.addCfgValset (UBLOX_CFG_USBINPROT_SPARTN, 0 );
178
+ }
160
179
}
161
180
162
181
if (commandSupported (UBLOX_CFG_NAVSPG_INFIL_MINCNO) == true )
@@ -597,7 +616,7 @@ bool messageSupported(int messageNumber)
597
616
598
617
return (messageSupported);
599
618
}
600
- // Given a command key, return true if that key is supported on this platform and fimrware version
619
+ // Given a command key, return true if that key is supported on this platform and firmware version
601
620
bool commandSupported (const uint32_t key)
602
621
{
603
622
bool commandSupported = false ;
0 commit comments