summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-08-01 11:13:41 -0700
committerGerrit <chrome-bot@google.com>2012-08-01 12:22:49 -0700
commit6c9f09738045efd84156304c7684bab4a009a5f1 (patch)
treef587a8105973c1b3d31c6909dd919e840b326a07
parenta8fae24b25d23753973a37ef47373291d674b775 (diff)
downloadvboot-6c9f09738045efd84156304c7684bab4a009a5f1.tar.gz
Revert "Enter key at DEV screen no longer transition to TONORM screen"
This reverts commit 2b45044edf702db665865de5b1b903346ed407a8 We will instead flush the keyboard buffer at the start of screens which accept keyboard input. Change-Id: I1f5a480c6c1eeb7432b557dd4d984c1450ac973e Reviewed-on: https://gerrit.chromium.org/gerrit/28952 Commit-Ready: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--firmware/include/vboot_api.h1
-rw-r--r--firmware/lib/vboot_api_kernel.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index eea39220..9aa7f0ad 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -578,7 +578,6 @@ enum VbKeyCode_t {
VB_KEY_LEFT = 0x102,
VB_KEY_RIGHT = 0x103,
VB_KEY_CTRL_ENTER = 0x104,
- VB_KEY_CTRL_REFRESH = 0x105
};
/* Read the next keypress from the keyboard buffer.
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 54c5bec2..9c5dd7f4 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -149,11 +149,11 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) {
case 0:
/* nothing pressed */
break;
+ case '\r':
case ' ':
case 0x1B:
- case VB_KEY_CTRL_REFRESH:
- /* Space, or ESC = request disable dev. Ctrl+F3 is used for testing. */
- VBDEBUG(("VbBootDeveloper() - user pressed SPACE/ESC/CTRL_F3\n"));
+ /* Enter, space, or ESC = reboot to recovery */
+ VBDEBUG(("VbBootDeveloper() - user pressed ENTER/SPACE/ESC\n"));
VbSetRecoveryRequest(VBNV_RECOVERY_RW_DEV_SCREEN);
VbAudioClose(audio);
return VBERROR_LOAD_KERNEL_RECOVERY;
@@ -223,16 +223,17 @@ static VbError_t VbConfirmChangeDevMode(VbCommonParams* cparams, int to_dev) {
while (1) {
if (VbExIsShutdownRequested())
return VBERROR_SHUTDOWN_REQUESTED;
- /* ENTER is always yes, ESC and SPACE are always no. */
+ /* ENTER is always yes, ESC is always no.
+ * SPACE is yes when leaving dev-mode, but is no when entering it. */
key = VbExKeyboardRead();
- if (key == '\r') {
+ if (key == '\r' || (key == ' ' && !to_dev)) {
VBDEBUG(("%s() - Yes: virtual dev-mode switch => %d\n",
__func__, to_dev));
if (TPM_SUCCESS != SetVirtualDevMode(to_dev))
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VBDEBUG(("%s() - Reboot so it will take effect\n", __func__));
return VBERROR_TPM_REBOOT_REQUIRED;
- } else if (key == 0x1B || key == ' ') {
+ } else if (key == 0x1B || (key == ' ' && to_dev)) {
VBDEBUG(("%s() - No: don't change virtual dev-mode switch\n", __func__));
VbDisplayScreen(cparams, VB_SCREEN_RECOVERY_INSERT, 0, &vnc);
return VBERROR_SUCCESS;