Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Firmware/RTK_Everywhere/Display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,16 @@ void setRadioIcons(std::vector<iconPropertyBlinking> *iconList)
}
}

if (usbSerialIncomingRtcm)
{
// Download : Columns 59 - 66
iconPropertyBlinking prop;
prop.icon = DownloadArrow128x64;
prop.duty = 0b11111111;
iconList->push_back(prop);
usbSerialIncomingRtcm = false;
}

if (wifiState == WIFI_STATE_CONNECTED)
{
if (netIncomingRTCM == true) // Download : Columns 59 - 66
Expand Down
3 changes: 3 additions & 0 deletions Firmware/RTK_Everywhere/RTK_Everywhere.ino
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ const byte haeNumberOfDecimals = 8; // Used for printing and transmitting lat/
bool lBandForceGetKeys; // Used to allow key update from display
unsigned long rtcmLastPacketReceived; // Time stamp of RTCM coming in (from BT, NTRIP, etc)
// Monitors the last time we received RTCM. Proctors PMP vs RTCM prioritization.

bool usbSerialIncomingRtcm; // Incoming RTCM over the USB serial port
#define RTCM_CORRECTION_INPUT_TIMEOUT (2 * 1000)
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

// GNSS configuration - UM980
Expand Down
100 changes: 72 additions & 28 deletions Firmware/RTK_Everywhere/menuMain.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// Report status if ~ received, otherwise present config menu
void terminalUpdate()
{
char buffer[128];
static uint32_t lastPeriodicDisplay;
int length;
static bool passRtcmToGnss;
static uint32_t rtcmTimer;

// Determine which items are periodically displayed
if ((millis() - lastPeriodicDisplay) >= settings.periodicDisplayInterval)
Expand All @@ -16,45 +20,85 @@ void terminalUpdate()
{
byte incoming = systemRead();

if (incoming == '~')
// Is this the start of an RTCM correction message
if (incoming == 0xd3)
{
// Output custom GNTXT message with all current system data
printCurrentConditionsNMEA();
// Enable RTCM reception
passRtcmToGnss = true;

// Start the RTCM timer
rtcmTimer = millis();
rtcmLastPacketReceived = rtcmTimer;

// Tell the display about the serial RTCM message
usbSerialIncomingRtcm = true;

// Read the beginning of the RTCM correction message
buffer[0] = incoming;
length = Serial.readBytes(&buffer[1], sizeof(buffer) - 1) + 1;

// Push RTCM to GNSS module over I2C / SPI
gnssPushRawData((uint8_t *)buffer, length);
}
else

// Does incoming data consist of RTCM correction messages
if (passRtcmToGnss && ((millis() - rtcmTimer) < RTCM_CORRECTION_INPUT_TIMEOUT))
{
// When outputting GNSS data to USB serial, check for +++
if (forwardGnssDataToUsbSerial)
{
static uint32_t plusTimeout;
static uint8_t plusCount;
// Renew the RTCM timer
rtcmTimer = millis();
rtcmLastPacketReceived = rtcmTimer;

// Reset plusCount on timeout
if ((millis() - plusTimeout) > PLUS_PLUS_PLUS_TIMEOUT)
plusCount = 0;
// Tell the display about the serial RTCM message
usbSerialIncomingRtcm = true;

// Check for + input
if (incoming != '+')
{
// Must start over looking for +++
plusCount = 0;
return;
}
// Read more of the RTCM correction message
buffer[0] = incoming;
length = Serial.readBytes(&buffer[1], sizeof(buffer) - 1) + 1;

// Push RTCM to GNSS module over I2C / SPI
gnssPushRawData((uint8_t *)buffer, length);
}
else
{
// Allow regular serial input
passRtcmToGnss = false;

if (incoming == '~')
{
// Output custom GNTXT message with all current system data
printCurrentConditionsNMEA();
}
else
{
// When outputting GNSS data to USB serial, check for +++
if (!forwardGnssDataToUsbSerial)
menuMain(); // Present user menu
else
{
// + entered, check for the +++ sequence
plusCount++;
if (plusCount < 3)
static uint32_t plusTimeout;
static uint8_t plusCount;

// Reset plusCount on timeout
if ((millis() - plusTimeout) > PLUS_PLUS_PLUS_TIMEOUT)
plusCount = 0;

// Check for + input
if (incoming != '+')
// Must start over looking for +++
plusCount = 0;
else
{
// Restart the timeout
plusTimeout = millis();
return;
// + entered, check for the +++ sequence
plusCount++;
if (plusCount < 3)
// Restart the timeout
plusTimeout = millis();
else
// +++ was entered, display the main menu
menuMain(); // Present user menu
}

// +++ was entered, display the main menu
}
}
menuMain(); // Present user menu
}
}
}
Expand Down