summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley Chen <shchen@chromium.org>2017-07-07 09:57:22 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-07-31 17:08:29 -0700
commit356eab1c8ea5310889e9fcaa95089cc742c8ef24 (patch)
treeab60f6728e229ad00ecb1767dd8d29de9f81a9c2
parent8b71425257d251858410de71efcf389df8b200d2 (diff)
downloadvboot-356eab1c8ea5310889e9fcaa95089cc742c8ef24.tar.gz
detachables: Set fw screen timeout to 30 secs upon button press
For detachables, the short delay is to fast to them to read/choose options. Setting timeout to 30 seconds once user starts scrolling through the menu. If no action is taken by the user, will retain the short delay timeout. BUG=b:63056097, b:35585623 BRANCH=None TEST=reboot with gbb flag bit 1 enabled and ensure using short delay. reboot and press volume button and make sure using long delay. reboot and make sure short delay performed again upon reboot. reboot and make sure gbb flag bit 1 = 0 and make sure long delay still working as expected. Change-Id: I31e3ca8aff6b29abca70ca9587deae7f6443d837 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/563817 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/lib/vboot_audio.c12
-rw-r--r--tests/vboot_api_devmode_tests.c3
-rw-r--r--tests/vboot_audio_tests.c2
3 files changed, 14 insertions, 3 deletions
diff --git a/firmware/lib/vboot_audio.c b/firmware/lib/vboot_audio.c
index b1b2b8c6..86145355 100644
--- a/firmware/lib/vboot_audio.c
+++ b/firmware/lib/vboot_audio.c
@@ -45,6 +45,9 @@ uint32_t short_count_ = sizeof(short_notes_) / sizeof(VbDevMusicNote);
/* No need to dynamically allocate this, is there? */
static VbAudioContext au;
+/* Flag to override GBB_FLAG_DEV_SCREEN_SHORT_DELAY gbb flag */
+int audio_open_count = 0;
+
/* Convert from msecs to VbExGetTimer() units. */
static uint64_t ticks_per_msec = 0; /* Initialized by VbAudioOpen() */
static uint64_t VbMsecToTicks(uint16_t msec) {
@@ -204,7 +207,6 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
audio->free_notes_when_done = 0;
}
-
/**
* Initialization function. Returns context for processing dev-mode delay.
*/
@@ -240,12 +242,16 @@ VbAudioContext *VbAudioOpen(VbCommonParams *cparams)
* Prepare to generate audio/delay event. Use a short developer screen
* delay if indicated by GBB flags.
*/
- if (gbb->major_version == GBB_MAJOR_VER && gbb->minor_version >= 1
- && (gbb->flags & GBB_FLAG_DEV_SCREEN_SHORT_DELAY)) {
+ if ((gbb->major_version == GBB_MAJOR_VER && gbb->minor_version >= 1
+ && (gbb->flags & GBB_FLAG_DEV_SCREEN_SHORT_DELAY))) {
VB2_DEBUG("VbAudioOpen() - using short dev screen delay\n");
use_short = 1;
}
+ /* Only use short dev screen delay on the first audio */
+ if (audio_open_count++ > 0)
+ use_short = 0;
+
VbGetDevMusicNotes(audio, use_short);
VB2_DEBUG("VbAudioOpen() - note count %d\n", audio->note_count);
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index cc24cee9..6ec74b29 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -149,6 +149,8 @@ static uint32_t kbd_fire_key;
static VbError_t beep_return;
static note_event_t *expected_event;
+extern int audio_open_count;
+
/* Reset mock data (for use before each test) */
static void ResetMocks(void) {
@@ -181,6 +183,7 @@ static void ResetMocks(void) {
kbd_fire_key = 0;
beep_return = VBERROR_SUCCESS;
+ audio_open_count = 0;
matched_events = 0;
max_events = 0;
diff --git a/tests/vboot_audio_tests.c b/tests/vboot_audio_tests.c
index 07ca438e..99d9bd4f 100644
--- a/tests/vboot_audio_tests.c
+++ b/tests/vboot_audio_tests.c
@@ -50,6 +50,7 @@ static uint8_t notebuf[sizeof(good_header) +
static VbDevMusic *use_hdr;
static VbDevMusicNote *use_notes;
static uint32_t use_size;
+extern int audio_open_count;
/* Set correct checksum for custom notes */
void FixChecksum(VbDevMusic *hdr) {
@@ -72,6 +73,7 @@ static void ResetMocks(void) {
memcpy(use_notes, good_notes, sizeof(good_notes));
FixChecksum(use_hdr);
use_size = sizeof(notebuf);
+ audio_open_count = 0;
}
/* Compare two sets of notes */