Skip to content
13 changes: 11 additions & 2 deletions Firmware/RTK_Everywhere/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ void beginBoard()
}
else if (productVariant == RTK_TORCH)
{
// Specify the GNSS radio
gnss = (GNSS *) new GNSS_UM980();

present.psram_2mb = true;
present.gnss_um980 = true;
present.radio_lora = true;
Expand Down Expand Up @@ -283,6 +286,9 @@ void beginBoard()

else if (productVariant == RTK_EVK)
{
// Specify the GNSS radio
gnss = (GNSS *) new GNSS_ZED();

// Pin defs etc. for EVK v1.1
present.psram_4mb = true;
present.gnss_zedf9p = true;
Expand Down Expand Up @@ -430,6 +436,9 @@ void beginBoard()
// mosaic COM3 is connected to the Data connector - via the multiplexer
// mosaic COM3 is available as a generic COM port. The firmware configures the baud. Nothing else.

// Specify the GNSS radio
gnss = (GNSS *) new GNSS_MOSAIC();

present.psram_4mb = true;
present.gnss_mosaicX5 = true;
present.display_i2c0 = true;
Expand Down Expand Up @@ -1474,9 +1483,9 @@ void tpISR()
{
if (millisNow < (timTpArrivalMillis + 999)) // Only sync if the GNSS time is not stale
{
if (gnssIsFullyResolved()) // Only sync if GNSS time is fully resolved
if (gnss->isFullyResolved()) // Only sync if GNSS time is fully resolved
{
if (gnssGetTimeAccuracy() < 5000) // Only sync if the tAcc is better than 5000ns
if (gnss->getTimeAccuracy() < 5000) // Only sync if the tAcc is better than 5000ns
{
// To perform the time zone adjustment correctly, it's easiest if we convert the GNSS
// time and date into Unix epoch first and then apply the timeZone offset
Expand Down
4 changes: 2 additions & 2 deletions Firmware/RTK_Everywhere/Bluetooth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void bluetoothTest(bool runTest)
{
tasksStopGnssUart(); // Stop absorbing serial via task from GNSS receiver

gnssSetBaudrate(115200 * 2);
gnss->setBaudrate(115200 * 2);

serialGNSS->begin(115200 * 2, SERIAL_8N1, pin_GnssUart_RX,
pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
Expand All @@ -498,7 +498,7 @@ void bluetoothTest(bool runTest)
else
bluetoothStatusText = "Offline";

gnssSetBaudrate(settings.dataPortBaud);
gnss->setBaudrate(settings.dataPortBaud);

serialGNSS->begin(settings.dataPortBaud, SERIAL_8N1, pin_GnssUart_RX,
pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/Buttons.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void powerDown(bool displayInfo)
// Disable SD card use
endSD(false, false);

gnssStandby(); // Put the GNSS into standby - if possible
gnss->standby(); // Put the GNSS into standby - if possible

// Prevent other tasks from logging, even if access to the microSD card was denied
online.logging = false;
Expand Down
22 changes: 11 additions & 11 deletions Firmware/RTK_Everywhere/Display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ void paintHorizontalAccuracy(displayCoords textCoords)
oled->setCursor(textCoords.x, textCoords.y); // x, y
oled->print(":");

float hpa = gnssGetHorizontalAccuracy();
float hpa = gnss->getHorizontalAccuracy();

if (online.gnss == false)
{
Expand Down Expand Up @@ -1322,7 +1322,7 @@ void paintClockAccuracy(displayCoords textCoords)
oled->setCursor(textCoords.x, textCoords.y); // x, y
oled->print(":");

uint32_t timeAccuracy = gnssGetTimeAccuracy();
uint32_t timeAccuracy = gnss->getTimeAccuracy();

if (online.gnss == false)
{
Expand Down Expand Up @@ -1530,7 +1530,7 @@ displayCoords paintSIVIcon(std::vector<iconPropertyBlinking> *iconList, const ic
icon = &SIVIconProperties;

// Determine if there is a fix
if (gnssIsFixed() == false)
if (gnss->isFixed() == false)
{
// override duty - blink satellite dish icon if we don't have a fix
duty = 0b01010101;
Expand Down Expand Up @@ -1561,10 +1561,10 @@ void paintSIVText(displayCoords textCoords)

if (online.gnss)
{
if (gnssIsFixed() == false)
if (gnss->isFixed() == false)
oled->print("0");
else
oled->print(gnssGetSatellitesInView());
oled->print(gnss->getSatellitesInView());

paintResets();
} // End gnss online
Expand Down Expand Up @@ -1646,8 +1646,8 @@ void paintBaseTempSurveyStarted(std::vector<iconPropertyBlinking> *iconList)

oled->setCursor(xPos + 29, yPos + 2); // x, y
oled->setFont(QW_FONT_8X16);
if (gnssGetSurveyInMeanAccuracy() < 10.0) // Error check
oled->print(gnssGetSurveyInMeanAccuracy(), 2);
if (gnss->getSurveyInMeanAccuracy() < 10.0) // Error check
oled->print(gnss->getSurveyInMeanAccuracy(), 2);
else
oled->print(">10");

Expand Down Expand Up @@ -1680,8 +1680,8 @@ void paintBaseTempSurveyStarted(std::vector<iconPropertyBlinking> *iconList)

oled->setCursor((uint8_t)((int)xPos + SIVTextStartXPosOffset[present.display_type]) + 30, yPos + 1); // x, y
oled->setFont(QW_FONT_8X16);
if (gnssGetSurveyInObservationTime() < 1000) // Error check
oled->print(gnssGetSurveyInObservationTime());
if (gnss->getSurveyInObservationTime() < 1000) // Error check
oled->print(gnss->getSurveyInObservationTime());
else
oled->print("0");
}
Expand Down Expand Up @@ -2364,9 +2364,9 @@ void paintSystemTest()
oled->print("GNSS:");
if (online.gnss == true)
{
gnssUpdate(); // Regularly poll to get latest data
gnss->update(); // Regularly poll to get latest data

int satsInView = gnssGetSatellitesInView();
int satsInView = gnss->getSatellitesInView();
if (satsInView > 5)
{
oled->print("OK");
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/ESPNOW.ino
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void espnowOnDataReceived(const esp_now_recv_info *mac, const uint8_t *incomingD
if (correctionLastSeen(CORR_ESPNOW))
{
// Pass RTCM bytes (presumably) from ESP NOW out ESP32-UART to GNSS
gnssPushRawData((uint8_t *)incomingData, len);
gnss->pushRawData((uint8_t *)incomingData, len);

if ((settings.debugEspNow == true || settings.debugCorrections == true) && !inMainMenu)
systemPrintf("ESPNOW received %d RTCM bytes, pushed to GNSS, RSSI: %d\r\n", len, espnowRSSI);
Expand Down
11 changes: 6 additions & 5 deletions Firmware/RTK_Everywhere/Form.ino
Original file line number Diff line number Diff line change
Expand Up @@ -873,15 +873,15 @@ void createDynamicDataString(char *settingsCSV)
settingsCSV[0] = '\0'; // Erase current settings string

// Current coordinates come from HPPOSLLH call back
stringRecord(settingsCSV, "geodeticLat", gnssGetLatitude(), haeNumberOfDecimals);
stringRecord(settingsCSV, "geodeticLon", gnssGetLongitude(), haeNumberOfDecimals);
stringRecord(settingsCSV, "geodeticAlt", gnssGetAltitude(), 3);
stringRecord(settingsCSV, "geodeticLat", gnss->getLatitude(), haeNumberOfDecimals);
stringRecord(settingsCSV, "geodeticLon", gnss->getLongitude(), haeNumberOfDecimals);
stringRecord(settingsCSV, "geodeticAlt", gnss->getAltitude(), 3);

double ecefX = 0;
double ecefY = 0;
double ecefZ = 0;

geodeticToEcef(gnssGetLatitude(), gnssGetLongitude(), gnssGetAltitude(), &ecefX, &ecefY, &ecefZ);
geodeticToEcef(gnss->getLatitude(), gnss->getLongitude(), gnss->getAltitude(), &ecefX, &ecefY, &ecefZ);

stringRecord(settingsCSV, "ecefX", ecefX, 3);
stringRecord(settingsCSV, "ecefY", ecefY, 3);
Expand Down Expand Up @@ -1108,7 +1108,8 @@ void createMessageListBase(String &returnText)

if (present.gnss_zedf9p)
{
int firstRTCMRecord = zedGetMessageNumberByName("RTCM_1005");
GNSS_ZED * zed = (GNSS_ZED *)gnss;
int firstRTCMRecord = zed->getMessageNumberByName("RTCM_1005");

for (int messageNumber = 0; messageNumber < MAX_UBX_MSG_RTCM; messageNumber++)
{
Expand Down
Loading