[coreboot-gerrit] New patch to review for coreboot: coreinfo: Allow numbers in addition to F keys
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Sat Mar 12 21:15:48 CET 2016
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14065
-gerrit
commit 13b27c00025e8f9c2fe7c304d4fad199375067c2
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date: Fri Mar 11 23:17:28 2016 -0800
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 at coreboot.org>
---
payloads/coreinfo/coreinfo.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c
index 41b5f12..d15a678 100644
--- a/payloads/coreinfo/coreinfo.c
+++ b/payloads/coreinfo/coreinfo.c
@@ -227,6 +227,8 @@ static void loop(void)
halfdelay(10);
while (1) {
+ int ch = -1;
+
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
print_time_and_date();
wrefresh(menuwin);
@@ -237,20 +239,21 @@ static void loop(void)
if (key == ERR)
continue;
- if (key >= KEY_F(1) && key <= KEY_F(9)) {
- unsigned char ch = key - KEY_F(1);
-
- if (ch <= ARRAY_SIZE(categories)) {
- if (ch == ARRAY_SIZE(categories))
- continue;
- if (categories[ch].count == 0)
- continue;
+ if (key >= KEY_F(1) && key <= KEY_F(9))
+ ch = key - KEY_F(1);
+ if (key >= '1' && key <= '9')
+ ch = key - '1';
- curwin = ch;
- print_submenu(&categories[curwin]);
- redraw_module(&categories[curwin]);
+ if (ch >= 0 && ch <= ARRAY_SIZE(categories)) {
+ if (ch == ARRAY_SIZE(categories))
+ continue;
+ if (categories[ch].count == 0)
continue;
- }
+
+ curwin = ch;
+ print_submenu(&categories[curwin]);
+ redraw_module(&categories[curwin]);
+ continue;
}
if (key == KEY_ESC)
More information about the coreboot-gerrit
mailing list