File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments