Skip to content

Commit 7c61999

Browse files
committed
Enable logging during base. Trim display for reset count.
1 parent 88aff51 commit 7c61999

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

Firmware/RTK_Surveyor/Base.ino

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool configureUbloxModuleBase()
4141
getPortSettings(COM_PORT_I2C); //Load the settingPayload with this port's settings
4242
if (settingPayload[OUTPUT_SETTING] != (COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3))
4343
response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); //Set the I2C port to output UBX (config), and RTCM3 (casting)
44-
//response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3); //Not a valid state. Goes to UBX+NMEA+RTCM3 -
44+
//response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3); //Not a valid state. Goes to UBX+NMEA+RTCM3 -
4545

4646
//In base mode the Surveyor should output RTCM over UART2 and I2C ports:
4747
//(Primary) UART2 in case the Surveyor is connected via radio to rover
@@ -99,10 +99,10 @@ bool beginSurveyIn()
9999
//Wait until active becomes true
100100
long maxTime = 5000;
101101
long startTime = millis();
102-
while(i2cGNSS.getSurveyInActive(100) == false)
102+
while (i2cGNSS.getSurveyInActive(100) == false)
103103
{
104104
delay(100);
105-
if(millis() - startTime > maxTime) return(false); //Reset of survey failed
105+
if (millis() - startTime > maxTime) return (false); //Reset of survey failed
106106
}
107107

108108
return (true);
@@ -119,19 +119,19 @@ bool resetSurvey()
119119
delay(1000);
120120
response &= i2cGNSS.disableSurveyMode(maxWait); //Disable survey
121121

122-
if(response == false)
123-
return(response);
122+
if (response == false)
123+
return (response);
124124

125125
//Wait until active and valid becomes false
126126
long maxTime = 5000;
127127
long startTime = millis();
128-
while(i2cGNSS.getSurveyInActive(100) == true || i2cGNSS.getSurveyInValid(100) == true)
128+
while (i2cGNSS.getSurveyInActive(100) == true || i2cGNSS.getSurveyInValid(100) == true)
129129
{
130130
delay(100);
131-
if(millis() - startTime > maxTime) return(false); //Reset of survey failed
131+
if (millis() - startTime > maxTime) return (false); //Reset of survey failed
132132
}
133133

134-
return(true);
134+
return (true);
135135
}
136136

137137
//Start the base using fixed coordinates
@@ -212,7 +212,11 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming)
212212
}
213213

214214
//Check for too many digits
215-
if (logIncreasing == true)
215+
if (settings.enableResetDisplay == true)
216+
{
217+
if (rtcmPacketsSent > 99) rtcmPacketsSent = 1; //Trim to two digits to avoid overlap
218+
}
219+
else if (logIncreasing == true)
216220
{
217221
if (rtcmPacketsSent > 999) rtcmPacketsSent = 1; //Trim to three digits to avoid log icon
218222
}

Firmware/RTK_Surveyor/Display.ino

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,7 @@ void paintSIV()
445445
oled.print(i2cGNSS.getSIV());
446446
}
447447

448-
if (settings.enableResetDisplay == true)
449-
{
450-
oled.setFontType(0); //Small font
451-
oled.setCursor(16 + (8 * 3) + 6, 38); //x, y
452-
oled.print(settings.resetCount);
453-
}
448+
paintResets();
454449
}
455450
}
456451

@@ -646,6 +641,8 @@ void paintBaseTempTransmitting()
646641
oled.setFontType(1); //Set font to type 1: 8x16
647642
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
648643

644+
paintResets();
645+
649646
paintLogging();
650647
}
651648
}
@@ -680,6 +677,8 @@ void paintBaseTempWiFiStarted()
680677
oled.setFontType(1); //Set font to type 1: 8x16
681678
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
682679

680+
paintResets();
681+
683682
paintLogging();
684683
}
685684
}
@@ -715,6 +714,8 @@ void paintBaseTempWiFiConnected()
715714
oled.setFontType(1); //Set font to type 1: 8x16
716715
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
717716

717+
paintResets();
718+
718719
paintLogging();
719720
}
720721
}
@@ -776,6 +777,8 @@ void paintBaseTempCasterConnected()
776777
oled.setFontType(1); //Set font to type 1: 8x16
777778
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
778779

780+
paintResets();
781+
779782
paintLogging();
780783
}
781784
}
@@ -822,6 +825,8 @@ void paintBaseFixedTransmitting()
822825
oled.setFontType(1); //Set font to type 1: 8x16
823826
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
824827

828+
paintResets();
829+
825830
paintLogging();
826831
}
827832
}
@@ -856,6 +861,8 @@ void paintBaseFixedWiFiStarted()
856861
oled.setFontType(1); //Set font to type 1: 8x16
857862
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
858863

864+
paintResets();
865+
859866
paintLogging();
860867
}
861868
}
@@ -891,6 +898,8 @@ void paintBaseFixedWiFiConnected()
891898
oled.setFontType(1); //Set font to type 1: 8x16
892899
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
893900

901+
paintResets();
902+
894903
paintLogging();
895904
}
896905
}
@@ -952,6 +961,8 @@ void paintBaseFixedCasterConnected()
952961
oled.setFontType(1); //Set font to type 1: 8x16
953962
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
954963

964+
paintResets();
965+
955966
paintLogging();
956967
}
957968
}
@@ -1558,3 +1569,16 @@ void displayMessage(const char* message, uint16_t displayTime)
15581569
delay(displayTime);
15591570
}
15601571
}
1572+
1573+
void paintResets()
1574+
{
1575+
if (online.display == true)
1576+
{
1577+
if (settings.enableResetDisplay == true)
1578+
{
1579+
oled.setFontType(0); //Small font
1580+
oled.setCursor(16 + (8 * 3) + 6, 38); //x, y
1581+
oled.print(settings.resetCount);
1582+
}
1583+
}
1584+
}

Firmware/RTK_Surveyor/States.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ void updateSystemState()
124124
//Stop all WiFi and BT. Re-enable in each specific base start state.
125125
stopWiFi();
126126
stopBluetooth();
127+
startUART2Tasks(); //Start monitoring the UART1 from ZED for NMEA and UBX data (enables logging)
127128

128129
if (configureUbloxModuleBase() == true)
129130
{

0 commit comments

Comments
 (0)