Skip to content

Commit 2315ecf

Browse files
committed
support: Pass serial port to serialInputClear
1 parent ae1cabe commit 2315ecf

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Firmware/RTK_Everywhere/Device_Firmware_Update.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void deviceFirmwareActionMenu(DEVICE_FIRMWARE_CTX * ctx)
7676
systemPrintf("x) Exit\r\n");
7777

7878
// Discard the input
79-
serialInputClear();
79+
serialInputClear(&Serial);
8080

8181
// Output the prompt
8282
systemPrintf("Select an action: ");
@@ -428,7 +428,7 @@ void deviceFirmwareDeviceListMenu(DEVICE_FIRMWARE_CTX * ctx)
428428
systemPrintf("x) Exit\r\n");
429429

430430
// Discard the input
431-
serialInputClear();
431+
serialInputClear(&Serial);
432432
ctx->_buffer[0] = 0;
433433
ctx->_validDataBytes = 0;
434434

@@ -494,7 +494,7 @@ void deviceFirmwareFileListMenu(DEVICE_FIRMWARE_CTX * ctx)
494494
systemPrintf("x) Exit\r\n");
495495

496496
// Discard the input
497-
serialInputClear();
497+
serialInputClear(&Serial);
498498
ctx->_buffer[0] = 0;
499499
ctx->_validDataBytes = 0;
500500

Firmware/RTK_Everywhere/System.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ void reportFatalError(const char *errorMsg)
948948
displayHalt();
949949

950950
// Empty the FIFO of any incoming data
951-
serialInputClear();
951+
serialInputClear(&Serial);
952952

953953
lastDisplayMsec = millis() - MILLISECONDS_IN_A_DAY;
954954
while (1)

Firmware/RTK_Everywhere/support.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,10 +1568,10 @@ int countAppPartitions()
15681568
//----------------------------------------
15691569
// Discard any input data
15701570
//----------------------------------------
1571-
void serialInputClear()
1571+
void serialInputClear(Stream * stream)
15721572
{
1573-
while (Serial.available())
1574-
Serial.read();
1573+
while (stream->available())
1574+
stream->read();
15751575
}
15761576

15771577
// Returns true if a file exists on LittleFS, false if not or if LittleFS is not mounted

0 commit comments

Comments
 (0)