diff options
Diffstat (limited to 'common/lightbar.c')
-rw-r--r-- | common/lightbar.c | 54 |
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) { |