@@ -118,58 +118,65 @@ void gnssDetectReceiverType()
118
118
gnssBoot (); // Tell GNSS to run
119
119
120
120
// TODO remove after testing, force retest on each boot
121
+ // Note: with this in place, the X5 detection will take a lot longer due to the baud rate change
121
122
settings.detectedGnssReceiver = GNSS_RECEIVER_UNKNOWN;
122
123
123
124
// Start auto-detect if NVM is not yet set
124
125
if (settings.detectedGnssReceiver == GNSS_RECEIVER_UNKNOWN)
125
126
{
127
+ // The COMPILE guards prevent else if
128
+ // Use a do while (0) so we can break when GNSS is detected
129
+ do {
126
130
#ifdef COMPILE_LG290P
127
- if (lg290pIsPresent () == true )
128
- {
129
- systemPrintln (" Auto-detected GNSS receiver: LG290P" );
130
-
131
- present.gnss_lg290p = true ;
132
- present.minCno = true ;
133
- present.minElevation = true ;
134
- present.needsExternalPpl = true ; // Uses the PointPerfect Library
135
-
136
- settings.detectedGnssReceiver = GNSS_RECEIVER_LG290P;
137
- recordSystemSettings (); // Record the detected GNSS receiver and avoid this test in the future
138
- }
131
+ if (lg290pIsPresent () == true )
132
+ {
133
+ systemPrintln (" Auto-detected GNSS receiver: LG290P" );
134
+ settings.detectedGnssReceiver = GNSS_RECEIVER_LG290P;
135
+ recordSystemSettings (); // Record the detected GNSS receiver and avoid this test in the future
136
+ break ;
137
+ }
139
138
#else // COMPILE_LGP290P
140
- systemPrintln (" <<<<<<<<<< !!!!!!!!!! LG290P NOT COMPILED !!!!!!!!!! >>>>>>>>>>" );
139
+ systemPrintln (" <<<<<<<<<< !!!!!!!!!! LG290P NOT COMPILED !!!!!!!!!! >>>>>>>>>>" );
141
140
#endif // COMPILE_LGP290P
142
141
143
142
#ifdef COMPILE_MOSAICX5
144
- if (mosaicIsPresentOnFlex () == true )
145
- {
146
- systemPrintln (" Auto-detected GNSS receiver: mosaic-X5" );
147
-
148
- present.gnss_mosaicX5 = true ;
149
- present.minCno = true ;
150
- present.minElevation = true ;
151
- present.dynamicModel = true ;
152
- present.needsExternalPpl = true ; // Uses the PointPerfect Library
153
-
154
- settings.detectedGnssReceiver = GNSS_RECEIVER_MOSAIC_X5;
155
- recordSystemSettings (); // Record the detected GNSS receiver and avoid this test in the future
156
- }
143
+ if (mosaicIsPresentOnFlex () == true ) // Note: this changes the COM1 baud from 115200 to 460800
144
+ {
145
+ systemPrintln (" Auto-detected GNSS receiver: mosaic-X5" );
146
+ settings.detectedGnssReceiver = GNSS_RECEIVER_MOSAIC_X5;
147
+ recordSystemSettings (); // Record the detected GNSS receiver and avoid this test in the future
148
+ break ;
149
+ }
157
150
#else // COMPILE_MOSAICX5
158
- systemPrintln (" <<<<<<<<<< !!!!!!!!!! MOSAICX5 NOT COMPILED !!!!!!!!!! >>>>>>>>>>" );
151
+ systemPrintln (" <<<<<<<<<< !!!!!!!!!! MOSAICX5 NOT COMPILED !!!!!!!!!! >>>>>>>>>>" );
159
152
#endif // COMPILE_MOSAICX5
153
+ } while (0 );
160
154
}
161
155
162
156
// Start the detected receiver
163
157
if (settings.detectedGnssReceiver == GNSS_RECEIVER_LG290P)
164
158
{
165
159
#ifdef COMPILE_LG290P
166
160
gnss = (GNSS *)new GNSS_LG290P ();
161
+
162
+ present.gnss_lg290p = true ;
163
+ present.minCno = true ;
164
+ present.minElevation = true ;
165
+ present.needsExternalPpl = true ; // Uses the PointPerfect Library
166
+
167
167
#endif // COMPILE_LGP290P
168
168
}
169
169
else if (settings.detectedGnssReceiver == GNSS_RECEIVER_MOSAIC_X5)
170
170
{
171
171
#ifdef COMPILE_MOSAICX5
172
172
gnss = (GNSS *)new GNSS_MOSAIC ();
173
+
174
+ present.gnss_mosaicX5 = true ;
175
+ present.minCno = true ;
176
+ present.minElevation = true ;
177
+ present.dynamicModel = true ;
178
+ // present.needsExternalPpl = true; // Nope. No L-Band support...
179
+
173
180
#endif // COMPILE_MOSAICX5
174
181
}
175
182
0 commit comments