소스 검색

[cmdline] Minor tidy-ups to shell_banner.c

tags/v0.9.4
Michael Brown 16 년 전
부모
커밋
764e2cc68c
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4
    4
      src/hci/shell_banner.c

+ 4
- 4
src/hci/shell_banner.c 파일 보기

20
 #include <console.h>
20
 #include <console.h>
21
 #include <unistd.h>
21
 #include <unistd.h>
22
 #include <config/general.h>
22
 #include <config/general.h>
23
+#include <gpxe/keys.h>
23
 #include <gpxe/shell_banner.h>
24
 #include <gpxe/shell_banner.h>
24
 
25
 
25
 /** @file
26
 /** @file
34
  * @ret	enter_shell		User wants to enter shell
35
  * @ret	enter_shell		User wants to enter shell
35
  */
36
  */
36
 int shell_banner ( void ) {
37
 int shell_banner ( void ) {
37
-	int wait_count = 0;
38
 	int enter_shell = 0;
38
 	int enter_shell = 0;
39
+	int wait_count;
39
 	int key;
40
 	int key;
40
 
41
 
41
 	printf ( "\nPress Ctrl-B for the gPXE command line..." );
42
 	printf ( "\nPress Ctrl-B for the gPXE command line..." );
42
 
43
 
43
 	/* Wait for key */
44
 	/* Wait for key */
44
-	while ( wait_count < BANNER_TIMEOUT ) {
45
+	for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
45
 		if ( iskey() ) {
46
 		if ( iskey() ) {
46
 			key = getchar();
47
 			key = getchar();
47
-			if ( key == 0x02 /* Ctrl-B */ )
48
+			if ( key == CTRL_B )
48
 				enter_shell = 1;
49
 				enter_shell = 1;
49
 			break;
50
 			break;
50
 		}
51
 		}
51
 		mdelay(100);
52
 		mdelay(100);
52
-		wait_count++;
53
 	}
53
 	}
54
 
54
 
55
 	/* Clear the "Press Ctrl-B" line */
55
 	/* Clear the "Press Ctrl-B" line */

Loading…
취소
저장