Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Firmware/RTK_Everywhere/Device_Firmware_Update.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void deviceFirmwareActionMenu(DEVICE_FIRMWARE_CTX * ctx)
systemPrintf("x) Exit\r\n");

// Discard the input
serialInputClear();
serialInputClear(&Serial);

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

// Discard the input
serialInputClear();
serialInputClear(&Serial);
ctx->_buffer[0] = 0;
ctx->_validDataBytes = 0;

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

// Discard the input
serialInputClear();
serialInputClear(&Serial);
ctx->_buffer[0] = 0;
ctx->_validDataBytes = 0;

Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/System.ino
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ void reportFatalError(const char *errorMsg)
displayHalt();

// Empty the FIFO of any incoming data
serialInputClear();
serialInputClear(&Serial);

lastDisplayMsec = millis() - MILLISECONDS_IN_A_DAY;
while (1)
Expand Down
6 changes: 3 additions & 3 deletions Firmware/RTK_Everywhere/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1568,10 +1568,10 @@ int countAppPartitions()
//----------------------------------------
// Discard any input data
//----------------------------------------
void serialInputClear()
void serialInputClear(Stream * stream)
{
while (Serial.available())
Serial.read();
while (stream->available())
stream->read();
}

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