Skip to content

Commit 53ec2c7

Browse files
authored
Merge pull request #453 from LeeLeahy2/usb-corrections
USB: Add USB serial as a correction source
2 parents 74e695e + fbcb931 commit 53ec2c7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ void terminalUpdate()
3838
length = Serial.readBytes(&buffer[1], sizeof(buffer) - 1) + 1;
3939

4040
// Push RTCM to GNSS module over I2C / SPI
41-
gnssPushRawData((uint8_t *)buffer, length);
41+
if (correctionLastSeen(CORR_USB))
42+
gnssPushRawData((uint8_t *)buffer, length);
4243
}
4344

4445
// Does incoming data consist of RTCM correction messages
@@ -56,7 +57,8 @@ void terminalUpdate()
5657
length = Serial.readBytes(&buffer[1], sizeof(buffer) - 1) + 1;
5758

5859
// Push RTCM to GNSS module over I2C / SPI
59-
gnssPushRawData((uint8_t *)buffer, length);
60+
if (correctionLastSeen(CORR_USB))
61+
gnssPushRawData((uint8_t *)buffer, length);
6062
}
6163
else
6264
{

Firmware/RTK_Everywhere/settings.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ typedef enum
124124
CORR_ESPNOW, // 1, 100 m Baseline, ESPNOW.ino
125125
CORR_RADIO_LORA, // 2, 1 km Baseline, UM980 only? Does data go direct from LoRa to UM980?
126126
CORR_BLUETOOTH, // 3, 10+km Baseline, Tasks.ino (sendGnssBuffer)
127-
CORR_TCP, // 4, 10+km Baseline, NtripClient.ino
128-
CORR_LBAND, // 5, 100 km Baseline, menuPP.ino for PMP - PointPerfectLibrary.ino for PPL
129-
CORR_IP, // 6, 100+km Baseline, MQTT_Client.ino
127+
CORR_USB, // 4, menuMain.ino (terminalUpdate)
128+
CORR_TCP, // 5, 10+km Baseline, NtripClient.ino
129+
CORR_LBAND, // 6, 100 km Baseline, menuPP.ino for PMP - PointPerfectLibrary.ino for PPL
130+
CORR_IP, // 7, 100+km Baseline, MQTT_Client.ino
130131
// Add new correction sources just above this line
131132
CORR_NUM
132133
} correctionsSource;
@@ -141,6 +142,7 @@ const char * const correctionsSourceNames[correctionsSource::CORR_NUM] =
141142
"ESP-Now",
142143
"LoRa Radio",
143144
"Bluetooth",
145+
"USB Serial",
144146
"TCP (NTRIP)",
145147
"L-Band",
146148
"IP (PointPerfect/MQTT)",

0 commit comments

Comments
 (0)