Skip to content

Commit 7ad1fe4

Browse files
committed
support: Pass serial port to serialInputClear
1 parent 35f6bab commit 7ad1fe4

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
@@ -74,7 +74,7 @@ void deviceFirmwareActionMenu(DEVICE_FIRMWARE_CTX * ctx)
7474
systemPrintf("x) Exit\r\n");
7575

7676
// Discard the input
77-
serialInputClear();
77+
serialInputClear(&Serial);
7878

7979
// Output the prompt
8080
systemPrintf("Select an action: ");
@@ -426,7 +426,7 @@ void deviceFirmwareDeviceListMenu(DEVICE_FIRMWARE_CTX * ctx)
426426
systemPrintf("x) Exit\r\n");
427427

428428
// Discard the input
429-
serialInputClear();
429+
serialInputClear(&Serial);
430430
ctx->_buffer[0] = 0;
431431
ctx->_validDataBytes = 0;
432432

@@ -492,7 +492,7 @@ void deviceFirmwareFileListMenu(DEVICE_FIRMWARE_CTX * ctx)
492492
systemPrintf("x) Exit\r\n");
493493

494494
// Discard the input
495-
serialInputClear();
495+
serialInputClear(&Serial);
496496
ctx->_buffer[0] = 0;
497497
ctx->_validDataBytes = 0;
498498

Firmware/RTK_Everywhere/System.ino

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

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

951951
lastDisplayMsec = millis() - MILLISECONDS_IN_A_DAY;
952952
while (1)

Firmware/RTK_Everywhere/support.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,8 @@ 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
}

0 commit comments

Comments
 (0)