Skip to content

Commit 9947415

Browse files
committed
Move UART1 serial test into display
1 parent 0bc9e4a commit 9947415

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,8 +1429,21 @@ void paintSystemTest()
14291429
oled.setCursor(xOffset, yOffset + (5 * charHeight) ); //x, y
14301430
oled.print(macAddress);
14311431
oled.print(":");
1432+
1433+
//Verify the ESP UART2 can communicate TX/RX to ZED UART1
14321434
if (zedUartPassed == false)
1433-
oled.print(F("FAIL"));
1435+
{
1436+
SFE_UBLOX_GNSS myGNSS;
1437+
1438+
//begin() attempts 3 connections
1439+
if (myGNSS.begin(serialGNSS) == true)
1440+
{
1441+
zedUartPassed = true;
1442+
oled.print(F("OK"));
1443+
}
1444+
else
1445+
oled.print(F("FAIL"));
1446+
}
14341447
else
14351448
oled.print(F("OK"));
14361449
}

Firmware/RTK_Surveyor/States.ino

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -641,24 +641,12 @@ void updateSystemState()
641641
//Debounce entry into test menu
642642
if (millis() - lastTestMenuChange > 500)
643643
{
644+
zedUartPassed = false;
645+
644646
//Enable RTCM 1230. This is the GLONASS bias sentence and is transmitted
645647
//even if there is no GPS fix. We use it to test serial output.
646648
i2cGNSS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_UART2, 1); //Enable message every second
647649

648-
//Verify the ESP UART2 can communicate TX/RX to ZED UART1
649-
SFE_UBLOX_GNSS myGNSS;
650-
651-
//Attempt 3 connections
652-
for (int x = 0 ; x < 3 ; x++)
653-
{
654-
if (myGNSS.begin(serialGNSS) == true)
655-
{
656-
zedUartPassed = true;
657-
break;
658-
}
659-
delay(250);
660-
}
661-
662650
changeState(STATE_TESTING);
663651
}
664652
}

Firmware/RTK_Surveyor/System.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ bool configureUbloxModule()
226226
if (getSerialRate(COM_PORT_UART1) != settings.dataPortBaud)
227227
{
228228
Serial.println(F("Updating UART1 rate"));
229-
i2cGNSS.setSerialRate(settings.dataPortBaud, COM_PORT_UART1); //Set UART1 to 115200
229+
i2cGNSS.setSerialRate(settings.dataPortBaud, COM_PORT_UART1);
230230
}
231-
if (getSerialRate(COM_PORT_UART2) != settings.radioPortBaud)
231+
if (getSerialRate(COM_PORT_UART2) != settings.radioPortBaud) //Defaults to 460800 to maximize message output support
232232
{
233233
Serial.println(F("Updating UART2 rate"));
234-
i2cGNSS.setSerialRate(settings.radioPortBaud, COM_PORT_UART2); //Set UART2 to 57600 to match SiK telemetry radio firmware default
234+
i2cGNSS.setSerialRate(settings.radioPortBaud, COM_PORT_UART2); //Defaults to 57600 to match SiK telemetry radio firmware default
235235
}
236236

237237
if (response == false)

0 commit comments

Comments
 (0)