summaryrefslogtreecommitdiff
path: root/common/lightbar.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-09-25 15:13:17 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-26 09:21:06 +0000
commitb88866828ffafb8fffb732d11f50f8b473bd4323 (patch)
treeb4be4e71fd1a2d49406d28c6d44662ad57d273ed /common/lightbar.c
parent748848e8a264530a0ed31fc62d11b19a42d11eec (diff)
downloadchrome-ec-b88866828ffafb8fffb732d11f50f8b473bd4323.tar.gz
Add demo_tap() function for lightbar demo mode
BUG=chrome-os-partner:29041 BRANCH=ToT TEST=manual From the host run ectool lightbar demo on Then press the 'T' key. The lightbar should change to indicate the charge state. Fiddle with the arrows to change the pretend battery level and AC presence. Change-Id: I398a829e2e5de5e1a186500aa2ed72c61e71deaa Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/220024 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common/lightbar.c')
-rw-r--r--common/lightbar.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/common/lightbar.c b/common/lightbar.c
index 6684949c8a..e7733bdf4b 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -76,13 +76,13 @@ static const struct lightbar_params_v1 default_params = {
.s3_ramp_up = 2500,
.s3_ramp_down = 10000,
.tap_tick_delay = 5000, /* oscillation step time */
- .tap_display_time = 3000000, /* total sequence time */
+ .tap_display_time = 5 * SECOND, /* total sequence time */
.tap_pct_red = 10, /* below this is red */
.tap_pct_green = 97, /* above this is green */
.tap_seg_min_on = 35, /* min intensity (%) for "on" */
.tap_seg_max_on = 100, /* max intensity (%) for "on" */
- .tap_seg_osc = 25, /* amplitude for charging osc */
+ .tap_seg_osc = 50, /* amplitude for charging osc */
.tap_idx = {5, 6, 7}, /* color [red, yellow, green] */
.osc_min = { 0x60, 0x60 }, /* battery, AC */
@@ -269,6 +269,14 @@ void demo_brightness(int inc)
lb_set_brightness(b);
}
+/* T key */
+void demo_tap(void)
+{
+ if (!demo_mode)
+ return;
+ lightbar_sequence(LIGHTBAR_TAP);
+}
+
/******************************************************************************/
/* Helper functions and data. */
/******************************************************************************/