Skip to content

Commit cc8b71c

Browse files
committed
WIP
1 parent 2316f10 commit cc8b71c

File tree

10 files changed

+387
-107
lines changed

10 files changed

+387
-107
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ void beginBoard()
334334
gnss = (GNSS *)new GNSS_ZED();
335335
#else // COMPILE_ZED
336336
gnss = (GNSS *)new GNSS_None();
337+
systemPrintln("<<<<<<<<<< !!!!!!!!!! ZED NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
337338
#endif // COMPILE_ZED
338339

339340
present.brand = BRAND_SPARKFUN;
@@ -464,6 +465,7 @@ void beginBoard()
464465
gnss = (GNSS *)new GNSS_ZED();
465466
#else // COMPILE_ZED
466467
gnss = (GNSS *)new GNSS_None();
468+
systemPrintln("<<<<<<<<<< !!!!!!!!!! ZED NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
467469
#endif // COMPILE_ZED
468470

469471
present.brand = BRAND_SPARKPNT;
@@ -546,6 +548,7 @@ void beginBoard()
546548
gnss = (GNSS *)new GNSS_ZED();
547549
#else // COMPILE_ZED
548550
gnss = (GNSS *)new GNSS_None();
551+
systemPrintln("<<<<<<<<<< !!!!!!!!!! ZED NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
549552
#endif // COMPILE_ZED
550553

551554
present.brand = BRAND_SPARKPNT;
@@ -635,6 +638,8 @@ void beginBoard()
635638
// mosaic COM3 is connected to the Data connector - via the multiplexer
636639
// mosaic COM3 is available as a generic COM port. The firmware configures the baud. Nothing else.
637640

641+
// NOTE: Facet Flex with mosaic-X5 is VERY different!
642+
638643
// Specify the GNSS radio
639644
#ifdef COMPILE_MOSAICX5
640645
gnss = (GNSS *)new GNSS_MOSAIC();
@@ -1166,6 +1171,11 @@ void pinGnssUartTask(void *pvParameters)
11661171
// LG290P communicates at 460800bps.
11671172
platformGnssCommunicationRate = 115200 * 4;
11681173
}
1174+
else if (settings.detectedGnssReceiver == GNSS_RECEIVER_MOSAIC_X5)
1175+
{
1176+
// Mosaic defaults to 115200, but mosaicIsPresentOnFlex() increases to 460800bps
1177+
platformGnssCommunicationRate = 115200 * 4;
1178+
}
11691179
else
11701180
{
11711181
// If we don't know the GNSS receiver, default to 115200

Firmware/RTK_Everywhere/GNSS.ino

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,21 @@ void gnssDetectReceiverType()
141141
#endif // COMPILE_LGP290P
142142

143143
#ifdef COMPILE_MOSAICX5
144-
// TODO - this uses UART2, but Flex is UART1. We need to make the mosaic send routines flexible to use
145-
// whichever UART we specify.
146-
// else if (mosaicIsPresent() == true)
147-
// {
148-
// systemPrintln("Auto-detected GNSS receiver: mosaic-X5");
149-
150-
// present.gnss_mosaicX5 = true;
151-
// present.minCno = true;
152-
// present.minElevation = true;
153-
// present.dynamicModel = true;
154-
// present.needsExternalPpl = true; // Uses the PointPerfect Library
155-
156-
// settings.detectedGnssReceiver = GNSS_RECEIVER_MOSAIC_X5;
157-
// recordSystemSettings(); // Record the detected GNSS receiver and avoid this test in the future
158-
// }
159-
#else // COMPILE_MOSAICX5
160-
else
144+
if (mosaicIsPresentOnFlex() == true)
161145
{
162-
systemPrintln("<<<<<<<<<< !!!!!!!!!! MOSAICX5 NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
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
163156
}
157+
#else // COMPILE_MOSAICX5
158+
systemPrintln("<<<<<<<<<< !!!!!!!!!! MOSAICX5 NOT COMPILED !!!!!!!!!! >>>>>>>>>>");
164159
#endif // COMPILE_MOSAICX5
165160
}
166161

@@ -169,14 +164,12 @@ void gnssDetectReceiverType()
169164
{
170165
#ifdef COMPILE_LG290P
171166
gnss = (GNSS *)new GNSS_LG290P();
172-
present.gnss_lg290p = true;
173167
#endif // COMPILE_LGP290P
174168
}
175169
else if (settings.detectedGnssReceiver == GNSS_RECEIVER_MOSAIC_X5)
176170
{
177171
#ifdef COMPILE_MOSAICX5
178172
gnss = (GNSS *)new GNSS_MOSAIC();
179-
present.gnss_mosaicX5 = true;
180173
#endif // COMPILE_MOSAICX5
181174
}
182175

Firmware/RTK_Everywhere/GNSS_Mosaic.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,8 @@ class GNSS_MOSAIC : GNSS
860860

861861
// Send commands out the UART to see if a mosaic module is present
862862
bool isPresent();
863+
bool isPresentOnSerial(HardwareSerial *serialPort, const char *command, const char *response, const char *console);
864+
bool mosaicIsPresentOnFlex();
863865

864866
// Some functions (L-Band area frequency determination) merely need
865867
// to know if we have an RTK Fix. This function checks to see if the
@@ -943,6 +945,14 @@ class GNSS_MOSAIC : GNSS
943945
char *response = nullptr,
944946
size_t responseSize = 0,
945947
bool debug = true);
948+
bool sendAndWaitForIdle(HardwareSerial *serialPort,
949+
const char *message,
950+
const char *reply,
951+
unsigned long timeout = 1000,
952+
unsigned long idle = 25,
953+
char *response = nullptr,
954+
size_t responseSize = 0,
955+
bool debug = true);
946956

947957
// Send message. Wait for up to timeout millis for reply to arrive
948958
// If the reply is received, keep reading bytes until the serial port has
@@ -985,6 +995,13 @@ class GNSS_MOSAIC : GNSS
985995
unsigned long wait = 25,
986996
char *response = nullptr,
987997
size_t responseSize = 0);
998+
bool sendWithResponse(HardwareSerial *serialPort,
999+
const char *message,
1000+
const char *reply,
1001+
unsigned long timeout = 1000,
1002+
unsigned long wait = 25,
1003+
char *response = nullptr,
1004+
size_t responseSize = 0);
9881005

9891006
// Send message. Wait for up to timeout millis for reply to arrive
9901007
// If the reply has started to be received when timeout is reached, wait for a further wait millis
@@ -1013,7 +1030,8 @@ class GNSS_MOSAIC : GNSS
10131030
// baudRate: New baud rate for the COM port
10141031
// Outputs:
10151032
// Returns true if the baud rate was set and false upon failure
1016-
bool setBaudRateCOM(uint8_t port, uint32_t baudRate);
1033+
bool setBaudRate(uint8_t uartNumber, uint32_t baudRate); // From the super class
1034+
bool setBaudRateCOM(uint8_t port, uint32_t baudRate); // Original X5 implementation
10171035

10181036
// Enable all the valid constellations and bands for this platform
10191037
bool setConstellations();
@@ -1094,7 +1112,7 @@ class GNSS_MOSAIC : GNSS
10941112

10951113
void updateSD();
10961114

1097-
void waitSBFReceiverSetup(unsigned long timeout);
1115+
void waitSBFReceiverSetup(HardwareSerial *serialPort, unsigned long timeout);
10981116
};
10991117

11001118
#endif // __GNSS_MOSAIC_H__

0 commit comments

Comments
 (0)