From f07ea5490bab8a2972e3b6d77ac67ca7cbf5cad0 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 9 Nov 2018 15:51:17 -0700 Subject: vboot_reference: Merge error beeping, printing, and logging Added a vb2_error_notify() function that bundles a log message, screen notification message, beep, and flash into one function, since callers were often calling these three things separately. BUG=chromium:899762 TEST=Image still builds and runs on an Aleena, function works on at least one of the calls, the others are harder to test. TEST=make runtests BRANCH=none Change-Id: I82224f8ffa1c326c5e7293a2c00db4dc5d80bf3a Reviewed-on: https://chromium-review.googlesource.com/1330013 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: Eugene Hermann Reviewed-by: Nick Crews Reviewed-by: Julius Werner --- firmware/lib/include/vboot_ui_common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'firmware/lib/include') diff --git a/firmware/lib/include/vboot_ui_common.h b/firmware/lib/include/vboot_ui_common.h index 30ade5a6..cc130a67 100644 --- a/firmware/lib/include/vboot_ui_common.h +++ b/firmware/lib/include/vboot_ui_common.h @@ -18,6 +18,18 @@ enum vb2_beep_type { */ void vb2_error_beep(enum vb2_beep_type beep); +/** + * Prints a message to screen, logs a possibly different message to log, + * and beeps to notify user. + * + * @print_msg Display message. NULL message will be ignored. + * @log_msg Log message. If NULL, uses @print_msg (if that's not NULL). + * @beep Type of beep sound. + */ +void vb2_error_notify(const char *print_msg, + const char *log_msg, + enum vb2_beep_type beep); + /** * Run alternative firmware if allowed * -- cgit v1.2.1