From c4db02fb9289235a0875c6226fe7fd3dd18adf55 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Fri, 16 Dec 2011 10:37:05 -0800 Subject: Add beep for x86 chormeos. Implement the VbExBeep function so that the DEV screen can beep. Much of this code was coppied from coreboot. BUG=chrome-os-partner:7114 TEST=manual, check that Stumpy beeps on DEV screen timeout and when booting from USB with dev_boot_usb=0. Change-Id: Icd4eabb0b10cc3d226db71e6a2b52d3ed7eb25ef Signed-off-by: Dylan Reid Reviewed-on: https://gerrit.chromium.org/gerrit/13110 Reviewed-by: Stefan Reinauer --- lib/vbexport/utility.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/vbexport/utility.c b/lib/vbexport/utility.c index 6bc53caed1..90a94be76b 100644 --- a/lib/vbexport/utility.c +++ b/lib/vbexport/utility.c @@ -16,6 +16,7 @@ #include #include #include +#include #include /* Import the definition of vboot_wrapper interfaces. */ @@ -89,10 +90,17 @@ void VbExSleepMs(uint32_t msec) VbError_t VbExBeep(uint32_t msec, uint32_t frequency) { - /* TODO Implement it later. */ - VbExSleepMs(msec); - VBDEBUG("Beep!\n"); - return VBERROR_NO_SOUND; + if (frequency) + enable_beep(); + else + disable_beep(); + + if (msec > 0) { + VbExSleepMs(msec); + disable_beep(); + } + + return VBERROR_SUCCESS; } int Memcmp(const void *src1, const void *src2, size_t n) -- cgit v1.2.3