From 90ee96f5c76a78aad8fddbd8eb7f9c6035d69996 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 20 Aug 2018 14:28:55 -0600 Subject: firmware/lib/vboot_ui: Add a VbExSleepMs to the developer mode UIs This won't have any real power savings until the APIC delay is merged and enabled. BUG=b:109749762 BRANCH=none TEST=Booted grunt and made sure the developer screens still worked. Change-Id: I7d75198771946415fa6a8fa69dff024d87ba5ef0 Signed-off-by: Raul E Rangel Reviewed-on: https://chromium-review.googlesource.com/1182190 Commit-Ready: ChromeOS CL Exonerator Bot Reviewed-by: Randall Spangler --- firmware/lib/vboot_ui.c | 5 +++++ firmware/lib/vboot_ui_menu.c | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'firmware') diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c index 640c4ff8..470e1500 100644 --- a/firmware/lib/vboot_ui.c +++ b/firmware/lib/vboot_ui.c @@ -153,6 +153,9 @@ int VbUserConfirms(struct vb2_context *ctx, uint32_t confirm_flags) return -1; } +/* Delay in developer ui */ +#define DEV_KEY_DELAY 20 /* Check keys every 20ms */ + static const char dev_disable_msg[] = "Developer mode is disabled on this device by system policy.\n" "For more information, see http://dev.chromium.org/chromium-os/fwmp\n" @@ -360,6 +363,8 @@ VbError_t vb2_developer_ui(struct vb2_context *ctx) VbCheckDisplayKey(ctx, key); break; } + + VbExSleepMs(DEV_KEY_DELAY); } while(vb2_audio_looping()); fallout: diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index c050ec8e..8cd65af6 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -633,6 +633,8 @@ static VbError_t vb2_handle_menu_input(struct vb2_context *ctx, return VBERROR_KEEP_LOOPING; } +/* Delay in developer menu */ +#define DEV_KEY_DELAY 20 /* Check keys every 20ms */ /** * Main function that handles developer warning menu functionality * @@ -707,6 +709,8 @@ static VbError_t vb2_developer_menu(struct vb2_context *ctx) if (key != 0) vb2_audio_start(ctx); + VbExSleepMs(DEV_KEY_DELAY); + /* If dev mode was disabled, loop forever (never timeout) */ } while(disable_dev_boot ? 1 : vb2_audio_looping()); -- cgit v1.2.1