summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_ui.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-16 04:16:55 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-19 08:58:00 -0700
commit25e898ff2f7e52e81d07f6849ff9a9227d81066a (patch)
tree4102ffa4a4fc3075931f6a024bcad9a69653b46f /firmware/lib/vboot_ui.c
parent7fb621f3f8432dd3f171c9477f8940574142c76b (diff)
downloadvboot-25e898ff2f7e52e81d07f6849ff9a9227d81066a.tar.gz
Export vb2_error_beep()
This code is used in both the keyboard and detachable UIs. Make it into a common function and export it. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I1e2cf67ec3fce9bc78ad412ddcc34e0eaecab5eb Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1286220 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_ui.c')
-rw-r--r--firmware/lib/vboot_ui.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index 0c4c03dc..0f1f7cc8 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -72,6 +72,14 @@ static int VbWantShutdown(struct vb2_context *ctx, uint32_t key)
return !!shutdown_request;
}
+/* Two short beeps to notify the user that attempted action was disallowed. */
+void vb2_error_beep(void)
+{
+ VbExBeep(120, 400);
+ VbExSleepMs(120);
+ VbExBeep(120, 400);
+}
+
int vb2_prepare_alt_fw(int allowed)
{
if (!allowed) {
@@ -90,9 +98,7 @@ int vb2_prepare_alt_fw(int allowed)
void vb2_exit_altfw(void)
{
- VbExBeep(120, 400);
- VbExSleepMs(120);
- VbExBeep(120, 400);
+ vb2_error_beep();
}
void vb2_try_alt_fw(int allowed, int altfw_num)
@@ -375,9 +381,7 @@ VbError_t vb2_developer_ui(struct vb2_context *ctx)
"(USB/SD) has not been enabled. Refer "
"to the developer-mode documentation "
"for details.\n");
- VbExBeep(120, 400);
- VbExSleepMs(120);
- VbExBeep(120, 400);
+ vb2_error_beep();
} else {
/*
* Clear the screen to show we get the Ctrl+U