mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Check keyboard more often in recovery mode
Currently we check the keyboard each 250ms. This makes for a pretty choppy experience when changing languages. Change to check every 20ms, without changing the disk check interval (which remains 1s). BUG=chrome-os-partner:13717 BRANCH=snow TEST=manual Boot into recovery Try changing language on snow with left/right arrow and see that it updates instantly. Change-Id: I2ae411bc36fdb2badac11595b099bca43f116669 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/32463 Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
This commit is contained in:
@@ -273,8 +273,9 @@ fallout:
|
|||||||
return VbTryLoadKernel(cparams, p, VB_DISK_FLAG_FIXED);
|
return VbTryLoadKernel(cparams, p, VB_DISK_FLAG_FIXED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delay between disk checks in recovery mode */
|
/* Delay in recovery mode */
|
||||||
#define REC_DELAY_INCREMENT 250
|
#define REC_DISK_DELAY 1000 /* Check disks every 1s */
|
||||||
|
#define REC_KEY_DELAY 20 /* Check keys every 20ms */
|
||||||
|
|
||||||
/* Handle a recovery-mode boot */
|
/* Handle a recovery-mode boot */
|
||||||
VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
|
VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
|
||||||
@@ -312,18 +313,18 @@ VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
|
|||||||
|
|
||||||
/* Scan keyboard more frequently than media, since x86 platforms
|
/* Scan keyboard more frequently than media, since x86 platforms
|
||||||
* don't like to scan USB too rapidly. */
|
* don't like to scan USB too rapidly. */
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < REC_DISK_DELAY; i += REC_KEY_DELAY) {
|
||||||
VbCheckDisplayKey(cparams, VbExKeyboardRead(), &vnc);
|
VbCheckDisplayKey(cparams, VbExKeyboardRead(), &vnc);
|
||||||
if (VbExIsShutdownRequested())
|
if (VbExIsShutdownRequested())
|
||||||
return VBERROR_SHUTDOWN_REQUESTED;
|
return VBERROR_SHUTDOWN_REQUESTED;
|
||||||
VbExSleepMs(REC_DELAY_INCREMENT);
|
VbExSleepMs(REC_KEY_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop and wait for a recovery image */
|
/* Loop and wait for a recovery image */
|
||||||
while (1) {
|
while (1) {
|
||||||
VBDEBUG(("VbBootRecovery() attempting to load kernel\n"));
|
VBDEBUG(("VbBootRecovery() attempting to load kernel2\n"));
|
||||||
retval = VbTryLoadKernel(cparams, p, VB_DISK_FLAG_REMOVABLE);
|
retval = VbTryLoadKernel(cparams, p, VB_DISK_FLAG_REMOVABLE);
|
||||||
|
|
||||||
/* Clear recovery requests from failed kernel loading, since we're
|
/* Clear recovery requests from failed kernel loading, since we're
|
||||||
@@ -340,7 +341,7 @@ VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
|
|||||||
|
|
||||||
/* Scan keyboard more frequently than media, since x86 platforms don't like
|
/* Scan keyboard more frequently than media, since x86 platforms don't like
|
||||||
* to scan USB too rapidly. */
|
* to scan USB too rapidly. */
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < REC_DISK_DELAY; i += REC_KEY_DELAY) {
|
||||||
key = VbExKeyboardRead();
|
key = VbExKeyboardRead();
|
||||||
/* We might want to enter dev-mode from the Insert screen if... */
|
/* We might want to enter dev-mode from the Insert screen if... */
|
||||||
if (key == 0x04 && /* user pressed Ctrl-D */
|
if (key == 0x04 && /* user pressed Ctrl-D */
|
||||||
@@ -370,7 +371,7 @@ VbError_t VbBootRecovery(VbCommonParams* cparams, LoadKernelParams* p) {
|
|||||||
VbCheckDisplayKey(cparams, key, &vnc);
|
VbCheckDisplayKey(cparams, key, &vnc);
|
||||||
if (VbExIsShutdownRequested())
|
if (VbExIsShutdownRequested())
|
||||||
return VBERROR_SHUTDOWN_REQUESTED;
|
return VBERROR_SHUTDOWN_REQUESTED;
|
||||||
VbExSleepMs(REC_DELAY_INCREMENT);
|
VbExSleepMs(REC_KEY_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user