Refactor dev-mode delay handling into a separate file.

BUG=none
TEST=manual

  cd src/platform/vboot_reference
  make && make runtests

Change-Id: I56feceb7d4fce80e4f50d5d7875eafef325363cc
Reviewed-on: http://gerrit.chromium.org/gerrit/8659
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2011-10-03 14:00:58 -07:00
parent 791c95fa23
commit 253a58e383
6 changed files with 189 additions and 108 deletions

View File

@@ -0,0 +1,25 @@
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Display functions used in kernel selection.
*/
#ifndef VBOOT_REFERENCE_VBOOT_AUDIO_H_
#define VBOOT_REFERENCE_VBOOT_AUDIO_H_
#include "vboot_api.h"
typedef struct VbAudioContext VbAudioContext;
/* Initialization function. Returns context for processing dev-mode delay */
VbAudioContext* VbAudioOpen(VbCommonParams* cparams);
/* Caller should loop without extra delay until this returns false */
int VbAudioLooping(VbAudioContext* audio);
/* Caller should call this prior to booting */
void VbAudioClose(VbAudioContext* audio);
#endif /* VBOOT_REFERENCE_VBOOT_AUDIO_H_ */

View File

@@ -21,18 +21,5 @@ VbError_t VbCheckDisplayKey(VbCommonParams* cparams, uint32_t key,
void VbExEasterEgg(VbCommonParams* cparams, VbNvContext *vncptr);
typedef struct VbDevMusicNote {
uint16_t msec;
uint16_t frequency;
} __attribute__((packed)) VbDevMusicNote;
typedef struct VbDevMusic {
uint8_t sig[4]; /* "$SND" */
uint32_t checksum; /* crc32 over count & all notes */
uint32_t count; /* number of notes */
VbDevMusicNote notes[1]; /* gcc allows [0], MSVC doesn't */
/* more VbDevMusicNotes follow immediately */
} __attribute__((packed)) VbDevMusic;
#endif /* VBOOT_REFERENCE_VBOOT_DISPLAY_H_ */