mirror of https://github.com/ipxe/ipxe.git
Keep running the main processing loop while waiting for input.
parent
1a11cc5c5b
commit
b6def29f2b
|
@ -1,5 +1,6 @@
|
|||
#include "stddef.h"
|
||||
#include "console.h"
|
||||
#include <gpxe/process.h>
|
||||
|
||||
/** @file */
|
||||
|
||||
|
@ -98,6 +99,11 @@ int getchar ( void ) {
|
|||
*/
|
||||
cpu_nap();
|
||||
|
||||
/* Keep processing background tasks while we wait for
|
||||
* input.
|
||||
*/
|
||||
step();
|
||||
|
||||
console = has_input();
|
||||
if ( console && console->getchar )
|
||||
character = console->getchar ();
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <console.h>
|
||||
#include <latch.h>
|
||||
#include <gpxe/process.h>
|
||||
#include <gpxe/keys.h>
|
||||
|
||||
/** @file
|
||||
|
@ -38,6 +39,7 @@ static int getchar_timeout ( unsigned long timeout ) {
|
|||
unsigned long expiry = ( currticks() + timeout );
|
||||
|
||||
while ( currticks() < expiry ) {
|
||||
step();
|
||||
if ( iskey() )
|
||||
return getchar();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue