Skip to content

Commit 715c749

Browse files
committed
Move debug setting so that it works during begin()
debuggingEnable() requires GNSS be marked online.
1 parent 729592c commit 715c749

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ void GNSS_UM980::begin()
6969
// Instantiate the library
7070
_um980 = new UM980();
7171

72-
// Turn on/off debug messages
73-
if (settings.debugGnss)
74-
debuggingEnable();
75-
7672
// In order to reduce UM980 configuration time, the UM980 library blocks the start of BESTNAV and RECTIME until 3D
7773
// fix is achieved However, if all NMEA messages are disabled, the UM980 will never detect a 3D fix.
7874
if (isGgaActive())
@@ -97,8 +93,14 @@ void GNSS_UM980::begin()
9793
return;
9894
}
9995
}
96+
97+
online.gnss = true;
98+
10099
systemPrintln("GNSS UM980 online");
101100

101+
if (settings.debugGnss)
102+
debuggingEnable(); // Print all debug to Serial
103+
102104
// Check firmware version and print info
103105
printModuleInfo();
104106

@@ -119,8 +121,6 @@ void GNSS_UM980::begin()
119121
gnssFirmwareVersionInt = 99;
120122

121123
snprintf(gnssUniqueId, sizeof(gnssUniqueId), "%s", _um980->getID());
122-
123-
online.gnss = true;
124124
}
125125

126126
//----------------------------------------
@@ -475,8 +475,10 @@ void GNSS_UM980::disableAllOutput()
475475
response &= _um980->disableOutputPort("COM2");
476476
response &= _um980->disableOutputPort("COM3");
477477
if (response)
478-
break;
478+
return;
479479
}
480+
481+
systemPrintln("UM980 failed to disable output");
480482
}
481483

482484
//----------------------------------------

0 commit comments

Comments
 (0)