Skip to content

Commit 6a7db3f

Browse files
committed
Move RTCM movement out of I2C ZED transport layer
Fix #222
1 parent 288c7de commit 6a7db3f

File tree

2 files changed

+18
-34
lines changed

2 files changed

+18
-34
lines changed

Firmware/RTK_Everywhere/Base.ino

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
// This function gets called when an RTCM packet passes parser check in processUart1Message() task
2+
// Pass data along to NTRIP Server, or ESP-NOW radio
3+
void processRTCM(uint8_t *rtcmData, uint16_t dataLength)
4+
{
5+
// Give this byte to the various possible transmission methods
6+
for (int x = 0; x < dataLength; x++)
7+
{
8+
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
9+
ntripServerProcessRTCM(serverIndex, rtcmData[x]);
10+
}
111

12+
for (int x = 0; x < dataLength; x++)
13+
espnowProcessRTCM(rtcmData[x]);
14+
15+
rtcmLastPacketSent = millis();
16+
rtcmPacketsSent++;
217

3-
// This function gets called from the SparkFun u-blox Arduino Library.
4-
// As each RTCM byte comes in you can specify what to do with it
5-
// Useful for passing the RTCM correction data to a radio, Ntrip broadcaster, etc.
6-
void DevUBLOXGNSS::processRTCM(uint8_t incoming)
7-
{
818
// Check for too many digits
919
if (settings.enableResetDisplay == true)
1020
{
@@ -16,22 +26,4 @@ void DevUBLOXGNSS::processRTCM(uint8_t incoming)
1626
if (rtcmPacketsSent > 999)
1727
rtcmPacketsSent = 1; // Trim to three digits to avoid log icon and increasing bar
1828
}
19-
20-
// Determine if we should check this byte with the RTCM checker or simply pass it along
21-
bool passAlongIncomingByte = true;
22-
23-
if (settings.enableRtcmMessageChecking == true)
24-
passAlongIncomingByte &= checkRtcmMessage(incoming);
25-
26-
// Give this byte to the various possible transmission methods
27-
if (passAlongIncomingByte)
28-
{
29-
rtcmLastReceived = millis();
30-
rtcmBytesSent++;
31-
32-
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
33-
ntripServerProcessRTCM(serverIndex, incoming);
34-
35-
espnowProcessRTCM(incoming);
36-
}
37-
}
29+
}

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ uint16_t ARPECEFH;
383383

384384
const byte haeNumberOfDecimals = 8; // Used for printing and transmitting lat/lon
385385
bool lBandForceGetKeys; // Used to allow key update from display
386-
unsigned long rtcmLastPacketReceived;
386+
unsigned long rtcmLastPacketReceived; //Time stamp of RTCM coming in (from BT, NTRIP, etc)
387387
// Monitors the last time we received RTCM. Proctors PMP vs RTCM prioritization.
388388
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
389389

@@ -667,8 +667,7 @@ bool logIncreasing; // Goes true when log file is greater than lastLogSize or lo
667667
bool reuseLastLog; // Goes true if we have a reset due to software (rather than POR)
668668

669669
uint16_t rtcmPacketsSent; // Used to count RTCM packets sent via processRTCM()
670-
uint32_t rtcmBytesSent;
671-
uint32_t rtcmLastReceived;
670+
uint32_t rtcmLastPacketSent; //Time stamp of RTCM going out (to NTRIP Server, ESP-NOW, etc)
672671

673672
uint32_t maxSurveyInWait_s = 60L * 15L; // Re-start survey-in after X seconds
674673

@@ -1421,13 +1420,6 @@ void rtcUpdate()
14211420
// Internal ESP NOW radio - Use the ESP32 to directly transmit/receive RTCM over 2.4GHz (no WiFi needed)
14221421
void updateRadio()
14231422
{
1424-
// If we have not gotten new RTCM bytes for a period of time, assume the end of frame
1425-
if (millis() - rtcmLastReceived > 50 && rtcmBytesSent > 0)
1426-
{
1427-
rtcmBytesSent = 0;
1428-
rtcmPacketsSent++; // If not checking RTCM CRC, count based on timeout
1429-
}
1430-
14311423
#ifdef COMPILE_ESPNOW
14321424
if (settings.enableEspNow == true)
14331425
{

0 commit comments

Comments
 (0)