mirror of https://github.com/ipxe/ipxe.git
[cmdline] Minor tidy-ups to shell_banner.c
parent
833447392d
commit
764e2cc68c
|
@ -20,6 +20,7 @@
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <config/general.h>
|
#include <config/general.h>
|
||||||
|
#include <gpxe/keys.h>
|
||||||
#include <gpxe/shell_banner.h>
|
#include <gpxe/shell_banner.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
@ -34,22 +35,21 @@
|
||||||
* @ret enter_shell User wants to enter shell
|
* @ret enter_shell User wants to enter shell
|
||||||
*/
|
*/
|
||||||
int shell_banner ( void ) {
|
int shell_banner ( void ) {
|
||||||
int wait_count = 0;
|
|
||||||
int enter_shell = 0;
|
int enter_shell = 0;
|
||||||
|
int wait_count;
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
printf ( "\nPress Ctrl-B for the gPXE command line..." );
|
printf ( "\nPress Ctrl-B for the gPXE command line..." );
|
||||||
|
|
||||||
/* Wait for key */
|
/* Wait for key */
|
||||||
while ( wait_count < BANNER_TIMEOUT ) {
|
for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
|
||||||
if ( iskey() ) {
|
if ( iskey() ) {
|
||||||
key = getchar();
|
key = getchar();
|
||||||
if ( key == 0x02 /* Ctrl-B */ )
|
if ( key == CTRL_B )
|
||||||
enter_shell = 1;
|
enter_shell = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mdelay(100);
|
mdelay(100);
|
||||||
wait_count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear the "Press Ctrl-B" line */
|
/* Clear the "Press Ctrl-B" line */
|
||||||
|
|
Loading…
Reference in New Issue