mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
coreinfo: Allow numbers in addition to F keys
When using coreinfo on a serial console (at least with gtkterm, picocom and minicom on Ubuntu 15.10) you can't send F keys to the payload. Allow 1..9 for F1..F9 Change-Id: Ie3a11fa1de57c7345737a1ccaff177f407cd5e48 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/14065 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
f3f654ddb9
commit
c2b50ace1b
1 changed files with 15 additions and 12 deletions
|
@ -247,6 +247,8 @@ static void loop(void)
|
||||||
halfdelay(10);
|
halfdelay(10);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
int ch = -1;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
|
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
|
||||||
print_time_and_date();
|
print_time_and_date();
|
||||||
wrefresh(menuwin);
|
wrefresh(menuwin);
|
||||||
|
@ -257,10 +259,12 @@ static void loop(void)
|
||||||
if (key == ERR)
|
if (key == ERR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (key >= KEY_F(1) && key <= KEY_F(9)) {
|
if (key >= KEY_F(1) && key <= KEY_F(9))
|
||||||
unsigned char ch = key - KEY_F(1);
|
ch = key - KEY_F(1);
|
||||||
|
if (key >= '1' && key <= '9')
|
||||||
|
ch = key - '1';
|
||||||
|
|
||||||
if (ch <= ARRAY_SIZE(categories)) {
|
if (ch >= 0 && ch <= ARRAY_SIZE(categories)) {
|
||||||
if (ch == ARRAY_SIZE(categories))
|
if (ch == ARRAY_SIZE(categories))
|
||||||
continue;
|
continue;
|
||||||
if (categories[ch].count == 0)
|
if (categories[ch].count == 0)
|
||||||
|
@ -271,7 +275,6 @@ static void loop(void)
|
||||||
redraw_module(&categories[curwin]);
|
redraw_module(&categories[curwin]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (key == KEY_ESC)
|
if (key == KEY_ESC)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue