mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
cros_ec: Use standard calls for recovery-request checking
Rather than calling directly into the sandbox SDL code, we can use the normal U-Boot console handling for this feature. Update the code, to make it more generic. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
656d744770
commit
56dae9ef3c
1 changed files with 11 additions and 7 deletions
|
@ -624,15 +624,19 @@ void cros_ec_check_keyboard(struct udevice *dev)
|
||||||
struct ec_state *ec = dev_get_priv(dev);
|
struct ec_state *ec = dev_get_priv(dev);
|
||||||
ulong start;
|
ulong start;
|
||||||
|
|
||||||
printf("Press keys for EC to detect on reset (ESC=recovery)...");
|
printf("\nPress keys for EC to detect on reset (ESC=recovery)...");
|
||||||
start = get_timer(0);
|
start = get_timer(0);
|
||||||
while (get_timer(start) < 1000)
|
while (get_timer(start) < 2000) {
|
||||||
;
|
if (tstc()) {
|
||||||
putc('\n');
|
int ch = getchar();
|
||||||
if (!sandbox_sdl_key_pressed(KEY_ESC)) {
|
|
||||||
ec->recovery_req = true;
|
if (ch == 0x1b) {
|
||||||
printf(" - EC requests recovery\n");
|
ec->recovery_req = true;
|
||||||
|
printf("EC requests recovery");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
putc('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the byte of EC switch states */
|
/* Return the byte of EC switch states */
|
||||||
|
|
Loading…
Reference in a new issue