summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-09-22 21:03:33 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-25 07:59:11 +0000
commit2939b986cfc4fc3f8b46b37b4d345bec270418ca (patch)
tree62cfc1afa45a6ada84c63c7c91f3a12724a12da2
parent7be8ff812ba802575be45e769d5ad833159b063a (diff)
downloadchrome-ec-2939b986cfc4fc3f8b46b37b4d345bec270418ca.tar.gz
lightbar: show google colors in S0 (red for low battery)
This removes the pulsing blue colors in S0. BUG=chrome-os-partner:31546 BRANCH=ToT TEST=manual Change-Id: Ib756b93bb51cb7b618958e5b1d270ba9cd1eef22 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/219417 Reviewed-by: Vic Yang <victoryang@chromium.org>
-rw-r--r--common/lightbar.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/common/lightbar.c b/common/lightbar.c
index a2643d607e..efd7d797a7 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -391,6 +391,10 @@ static uint32_t sequence_S3S0(void)
if (res)
return res;
+#ifndef BLUE_PULSING
+ return 0;
+#endif
+
/* Ramp up to starting brightness, using S0 colors */
ci = st.p.s0_idx[st.battery_is_charging][st.battery_level];
if (ci >= ARRAY_SIZE(st.p.color))
@@ -415,6 +419,8 @@ static uint32_t sequence_S3S0(void)
return 0;
}
+#ifdef BLUE_PULSING
+
/* CPU is fully on */
static uint32_t sequence_S0(void)
{
@@ -480,6 +486,54 @@ static uint32_t sequence_S0(void)
return 0;
}
+#else /* just simple google colors */
+
+static uint32_t sequence_S0(void)
+{
+ int w, i, r, g, b;
+ int f;
+
+ lb_set_rgb(NUM_LEDS, 0, 0, 0);
+ lb_on();
+
+ /* Ramp up */
+ for (w = 0; w < 128; w += 2) {
+ f = cycle_010(w);
+ for (i = 0; i < NUM_LEDS; i++) {
+ r = st.p.color[i].r * f / FP_SCALE;
+ g = st.p.color[i].g * f / FP_SCALE;
+ b = st.p.color[i].b * f / FP_SCALE;
+ lb_set_rgb(i, r, g, b);
+ }
+ WAIT_OR_RET(st.p.google_ramp_up);
+ }
+
+ while (1) {
+
+ get_battery_level();
+
+ /* Not really low use google colors */
+ if (st.battery_level) {
+ for (i = 0; i < NUM_LEDS; i++) {
+ r = st.p.color[i].r;
+ g = st.p.color[i].g;
+ b = st.p.color[i].b;
+ lb_set_rgb(i, r, g, b);
+ }
+ } else {
+ r = st.p.color[5].r;
+ g = st.p.color[5].g;
+ b = st.p.color[5].b;
+ lb_set_rgb(4, r, g, b);
+ }
+
+ WAIT_OR_RET(1 * SECOND);
+ }
+ return 0;
+}
+
+#endif
+
/* CPU is going to sleep. */
static uint32_t sequence_S0S3(void)
{