Skip to content

Commit 2ea521b

Browse files
committed
Defining LG290P UARTs for Torch X2
1 parent 4231f4f commit 2ea521b

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@ void beginBoard()
888888

889889
pin_GNSS_TimePulse = 39; // PPS on UM980
890890

891-
pin_muxB = 12;
892891
pin_usbSelect = 12; // Controls U18 switch between ESP UART0 to USB or GNSS UART1
893892
pin_powerAdapterDetect = 36; // Goes low when USB cable is plugged in
894893

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const char *GNSS_LG290P::getRtcmLowDataRateString()
6767
void GNSS_LG290P::begin()
6868
{
6969
// During identifyBoard(), the GNSS UART and DR pins are set
70-
Serial.println("LG begin");
7170

7271
// The GNSS UART is already started. We can now pass it to the library.
7372
if (serialGNSS == nullptr)
@@ -1184,6 +1183,12 @@ uint32_t GNSS_LG290P::getDataBaudRate()
11841183
// This is nicknamed the DATA port
11851184
dataUart = 1;
11861185
}
1186+
else if (productVariant == RTK_TORCH_X2)
1187+
{
1188+
// UART3 of the LG290P is connected to USB CH342 (Port A)
1189+
// This is nicknamed the DATA port
1190+
dataUart = 3;
1191+
}
11871192
return (getBaudRate(dataUart));
11881193
}
11891194

@@ -1203,6 +1208,15 @@ bool GNSS_LG290P::setDataBaudRate(uint32_t baud)
12031208
return (setBaudRate(1, baud));
12041209
}
12051210
}
1211+
else if (productVariant == RTK_TORCH_X2)
1212+
{
1213+
if (getDataBaudRate() != baud)
1214+
{
1215+
// UART3 of the LG290P is connected to USB CH342 (Port A)
1216+
// This is nicknamed the DATA port
1217+
return (setBaudRate(3, baud));
1218+
}
1219+
}
12061220
else
12071221
{
12081222
// On products that don't have a DATA port (Flex), act as if we have set the baud successfully
@@ -1228,6 +1242,12 @@ uint32_t GNSS_LG290P::getRadioBaudRate()
12281242
// UART2 of the LG290P is connected to SW4, which is connected to LoRa UART0
12291243
radioUart = 2;
12301244
}
1245+
else if (productVariant == RTK_TORCH_X2)
1246+
{
1247+
// UART1 of the LG290P is connected to SW, which is connected to ESP32 UART0
1248+
// Not really used at this time but available for configuration
1249+
radioUart = 1;
1250+
}
12311251
return (getBaudRate(radioUart));
12321252
}
12331253

@@ -1255,6 +1275,12 @@ bool GNSS_LG290P::setRadioBaudRate(uint32_t baud)
12551275
// UART2 of the LG290P is connected to SW4, which is connected to LoRa UART0
12561276
radioUart = 2;
12571277
}
1278+
else if (productVariant == RTK_TORCH_X2)
1279+
{
1280+
// UART1 of the LG290P is connected to SW, which is connected to ESP32 UART0
1281+
// Not really used at this time but available for configuration
1282+
radioUart = 1;
1283+
}
12581284
return (setBaudRate(radioUart, baud));
12591285
}
12601286
}

Firmware/RTK_Everywhere/TcpServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ void tcpServerClientUpdate(uint8_t index)
461461
if(tcpServerClient[index] == nullptr)
462462
{
463463
if (settings.debugTcpServer)
464-
Serial.printf("ERROR: Failed to allocate %s client!\r\n", tcpServerName);
464+
systemPrintf("ERROR: Failed to allocate %s client!\r\n", tcpServerName);
465465
break;
466466
}
467467
}

Firmware/RTK_Everywhere/WebServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static const char *const webServerStateNames[] = {
3737
webServer->on(page, HTTP_GET, []() { \
3838
String length; \
3939
if (settings.debugWebServer == true) \
40-
Serial.printf("WebServer: Sending %s (%p, %d bytes)\r\n", page, (void *)data, sizeof(data)); \
40+
systemPrintf("WebServer: Sending %s (%p, %d bytes)\r\n", page, (void *)data, sizeof(data)); \
4141
webServer->sendHeader("Content-Encoding", "gzip"); \
4242
length = String(sizeof(data)); \
4343
webServer->sendHeader("Content-Length", length.c_str()); \

0 commit comments

Comments
 (0)