Skip to content

Commit 3202cc5

Browse files
committed
Bulk processing incoming serial from ZED.
1 parent 6d04c5a commit 3202cc5

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ uint8_t *ringBuffer; // Buffer for reading from F9P. At 230400bps, 23040 bytes/s
400400
// * 0.25 = 5760 bytes worst case.
401401
TaskHandle_t gnssReadTaskHandle =
402402
nullptr; // Store handles so that we can kill them if user goes into WiFi NTRIP Server mode
403-
const int gnssReadTaskStackSize = 2000;
403+
const int gnssReadTaskStackSize = 2500;
404404

405405
TaskHandle_t handleGnssDataTaskHandle = nullptr;
406406
const int handleGnssDataTaskStackSize = 3000;

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,22 @@ void gnssReadTask(void *e)
151151
while (serialGNSS.available())
152152
{
153153
// Read the data from UART1
154-
incomingData = serialGNSS.read();
154+
uint8_t incomingData[500];
155+
int bytesIncoming = serialGNSS.read(incomingData, sizeof(incomingData));
155156

156-
// Save the data byte
157-
parse.buffer[parse.length++] = incomingData;
158-
parse.length %= PARSE_BUFFER_LENGTH;
157+
for (int x = 0; x < bytesIncoming; x++)
158+
{
159+
// Save the data byte
160+
parse.buffer[parse.length++] = incomingData[x];
161+
parse.length %= PARSE_BUFFER_LENGTH;
159162

160-
// Compute the CRC value for the message
161-
if (parse.computeCrc)
162-
parse.crc = COMPUTE_CRC24Q(&parse, incomingData);
163+
// Compute the CRC value for the message
164+
if (parse.computeCrc)
165+
parse.crc = COMPUTE_CRC24Q(&parse, incomingData[x]);
163166

164-
// Update the parser state based on the incoming byte
165-
parse.state(&parse, incomingData);
167+
// Update the parser state based on the incoming byte
168+
parse.state(&parse, incomingData[x]);
169+
}
166170
}
167171
}
168172
else // SPI GNSS
@@ -663,8 +667,8 @@ void ButtonCheckTask(void *e)
663667
if (millis() - lastRockerSwitchChange < 500)
664668
{
665669
if (systemState == STATE_ROVER_NOT_STARTED && online.display == true) // Catch during Power On
666-
requestChangeState(STATE_TEST); // If RTK Surveyor, with display attached, during Rover not
667-
// started, then enter test mode
670+
requestChangeState(STATE_TEST); // If RTK Surveyor, with display attached, during Rover not
671+
// started, then enter test mode
668672
else
669673
requestChangeState(STATE_WIFI_CONFIG_NOT_STARTED);
670674
}

0 commit comments

Comments
 (0)