Skip to content

Commit ac76d57

Browse files
authored
Merge pull request #240 from LeeLeahy2/casting-off
Display Casting Off or Xmitting Off when not connected
2 parents 15fc812 + cfa1efe commit ac76d57

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ void printTextwithKerning(const char *newText, uint8_t xPos, uint8_t yPos, uint8
921921
//Show transmission of RTCM correction data packets to NTRIP caster
922922
void paintRTCM()
923923
{
924+
static uint32_t lastCorrectionDataSeen;
924925
int textY = 17;
925926
int textKerning = 8;
926927
oled.setFont(QW_FONT_8X16);
@@ -935,17 +936,30 @@ void paintRTCM()
935936
printTextwithKerning("Casting", textX, textY, textKerning); //via WiFi
936937
}
937938

938-
oled.setCursor(0, 39); //x, y
939-
oled.setFont(QW_FONT_5X7);
940-
oled.print("RTCM:");
941-
942-
if (rtcmPacketsSent < 100)
943-
oled.setCursor(30, 36); //x, y - Give space for two digits
939+
//Determine if correction data has been sent recently
940+
if (online.txNtripDataCasting)
941+
lastCorrectionDataSeen = millis();
942+
if ((millis() - lastCorrectionDataSeen) >= 5000)
943+
{
944+
//No correction data seen
945+
oled.setCursor(0, 33); //x, y
946+
oled.print("Off");
947+
}
944948
else
945-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
949+
{
950+
oled.setCursor(0, 39); //x, y
951+
oled.setFont(QW_FONT_5X7);
952+
oled.print("RTCM:");
946953

947-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
948-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
954+
if (rtcmPacketsSent < 100)
955+
oled.setCursor(30, 36); //x, y - Give space for two digits
956+
else
957+
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
958+
959+
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
960+
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
961+
online.txNtripDataCasting = false;
962+
}
949963

950964
paintResets();
951965
}

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ void ntripServerProcessRTCM(uint8_t incoming)
357357
ntripServer->write(incoming); //Send this byte to socket
358358
ntripServerBytesSent++;
359359
ntripServerTimer = millis();
360+
online.txNtripDataCasting = true;
360361
}
361362

362363
//Indicate that the GNSS is providing correction data

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void F9PSerialReadTask(void *e)
127127
if (length)
128128
s = serialGNSS.readBytes(rBuffer, length);
129129

130-
//Account for the byte read
130+
//Account for the bytes read
131131
if (s > 0)
132132
{
133133
//Set the next fill offset
@@ -158,8 +158,11 @@ void F9PSerialReadTask(void *e)
158158
length = sizeof(rBuffer) - rBufferBtOffset;
159159

160160
if ((bluetoothIsCongested() == false) || (settings.throttleDuringSPPCongestion == false))
161+
{
161162
//Push new data to BT SPP if not congested or not throttling
162163
length = bluetoothWriteBytes(&rBuffer[rBufferBtOffset], length);
164+
online.txNtripDataCasting = true;
165+
}
163166
else
164167
{
165168
//Don't push data to BT SPP if there is congestion to prevent heap hits.

Firmware/RTK_Surveyor/settings.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,9 @@ struct struct_online {
447447
bool battery = false;
448448
bool accelerometer = false;
449449
bool ntripClient = false;
450-
bool ntripServer = false;
451450
bool rxRtcmCorrectionData = false;
451+
bool ntripServer = false;
452+
bool txNtripDataCasting = false;
452453
bool lband = false;
453454
bool lbandCorrections = false;
454455
} online;

0 commit comments

Comments
 (0)