Skip to content

Commit 321837b

Browse files
committed
Allow UM980 binary messages when GGA is disabled
1 parent f4c646e commit 321837b

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

Firmware/RTK_Everywhere/UM980.ino

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ void um980Begin()
3333
if (settings.debugGnss == true)
3434
um980EnableDebugging();
3535

36-
um980->disableBinaryBeforeFix(); // Block the start of BESTNAV and RECTIME until 3D fix is achieved
36+
// In order to reduce UM980 configuration time, the UM980 library blocks the start of BESTNAV and RECTIME until 3D fix is achieved
37+
// However, if all NMEA messages are disabled, the UM980 will never detect a 3D fix.
38+
if (um980IsGgaActive() == true)
39+
//If NMEA GPGGA is turned on, suppress BESTNAV messages until GPGGA reports a 3D fix
40+
um980->disableBinaryBeforeFix();
41+
else
42+
//If NMEA GPGGA is turned off, enable BESTNAV messages at power on which may lead to longer UM980 configuration times
43+
um980->enableBinaryBeforeFix();
44+
3745

3846
if (um980->begin(*serialGNSS) == false) // Give the serial port over to the library
3947
{
@@ -297,7 +305,8 @@ bool um980ConfigureBase()
297305
bool response = true;
298306

299307
// Set the dynamic mode. This will cancel any base averaging mode and is needed
300-
// to allow a freshly started device to settle in regular GNSS reception mode before issuing um980BaseAverageStart().
308+
// to allow a freshly started device to settle in regular GNSS reception mode before issuing
309+
// um980BaseAverageStart().
301310
response &= um980SetModel(settings.dynamicModel);
302311

303312
response &= um980EnableRTCMBase(); // Only turn on messages, do not turn off messages. We assume the caller has
@@ -832,6 +841,8 @@ bool um980SetModeRoverSurvey()
832841
return (um980->setModeRoverSurvey());
833842
}
834843

844+
// If we have received serial data from the UM980 outside of the Unicore library (ie, from processUart1Message task)
845+
// we can pass data back into the Unicore library to allow it to update its own variables
835846
void um980UnicoreHandler(uint8_t *buffer, int length)
836847
{
837848
um980->unicoreHandler(buffer, length);
@@ -862,10 +873,37 @@ uint8_t um980GetActiveMessageCount()
862873
{
863874
uint8_t count = 0;
864875

876+
count += um980GetActiveNmeaMessageCount();
877+
878+
count += um980GetActiveRtcmMessageCount();
879+
880+
return (count);
881+
}
882+
883+
uint8_t um980GetActiveNmeaMessageCount()
884+
{
885+
uint8_t count = 0;
886+
865887
for (int x = 0; x < MAX_UM980_NMEA_MSG; x++)
866888
if (settings.um980MessageRatesNMEA[x] > 0)
867889
count++;
868890

891+
return (count);
892+
}
893+
894+
// Return true if the GPGGA message is active
895+
bool um980IsGgaActive()
896+
{
897+
// 2 = GPGGA. We could do this with a walking text search but this is sufficient.
898+
if(settings.um980MessageRatesNMEA[2] > 0)
899+
return (true);
900+
return (false);
901+
}
902+
903+
uint8_t um980GetActiveRtcmMessageCount()
904+
{
905+
uint8_t count = 0;
906+
869907
// Determine which state we are in
870908
if (um980InRoverMode() == true)
871909
{

0 commit comments

Comments
 (0)