diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-10-17 10:30:00 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-17 12:50:26 -0700 |
commit | f574f1c37c2d72d2cb064bda6546fa7d1f047cea (patch) | |
tree | 9bf2fba0998e954be81f53cd1840e5ca24ffc49b | |
parent | a2c0103908876afd1999f607ae5a285958c2b3a0 (diff) | |
download | chrome-ec-f574f1c37c2d72d2cb064bda6546fa7d1f047cea.tar.gz |
Make S3 red-light flash adjustable.
This makes the timing for the S3 low-power indicator adjustable without
reflashing.
BUG=chrome-os-partner:8039
BRANCH=Link
TEST=manual
Boot, log in, run this to put the lightbar into demo mode:
ectool lightbar demo 1
ectool lightbar seq s3s0
The lightbar should act as though the system is asleep.
Then press the left arrow a couple of times and the down-arrow four or five
times. You should see the red light pulse every 5 seconds or so.
Now run
ectool lightbar params > /tmp/w
Edit /tmp/w to change the timing lines to this:
100 # .s3_ramp_up
100 # .s3_ramp_down
Then run
ectool lightbar params /tmp/w
After a cycle or two, you should see the lightbar flash instead of pulse.
Change-Id: If815ff2fb9a158c0e1f4dbb6a269ad07e122d84c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35839
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | common/lightbar.c | 10 | ||||
-rw-r--r-- | include/ec_commands.h | 3 | ||||
-rw-r--r-- | util/ectool.c | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index 5f37472935..bdf3211304 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -184,7 +184,8 @@ static const struct lightbar_params default_params = { .s0a_tick_delay = { 5000, 3000 }, /* battery, AC */ .s0s3_ramp_down = 2000, .s3_sleep_for = 5000000, /* between checks */ - .s3_tick_delay = 15000, + .s3_ramp_up = 2500, + .s3_ramp_down = 10000, .new_s0 = 1, /* 0=gentle, 1=pulse */ @@ -672,7 +673,7 @@ static uint32_t sequence_S3(void) g = st.p.color[ci].g * f; b = st.p.color[ci].b * f; lightbar_setrgb(NUM_LEDS, r, g, b); - WAIT_OR_RET(st.p.google_ramp_up); + WAIT_OR_RET(st.p.s3_ramp_up); } for (w = 128; w <= 256; w++) { f = cycle_010(w); @@ -680,7 +681,7 @@ static uint32_t sequence_S3(void) g = st.p.color[ci].g * f; b = st.p.color[ci].b * f; lightbar_setrgb(NUM_LEDS, r, g, b); - WAIT_OR_RET(st.p.google_ramp_down); + WAIT_OR_RET(st.p.s3_ramp_down); } lightbar_setrgb(NUM_LEDS, 0, 0, 0); @@ -1224,7 +1225,8 @@ static void show_params(const struct lightbar_params *p) ccprintf("%d\t\t# .s0a_tick_delay (AC)\n", p->s0a_tick_delay[1]); ccprintf("%d\t\t# .s0s3_ramp_down\n", p->s0s3_ramp_down); ccprintf("%d\t# .s3_sleep_for\n", p->s3_sleep_for); - ccprintf("%d\t\t# .s3_tick_delay\n", p->s3_tick_delay); + ccprintf("%d\t\t# .s3_ramp_up\n", p->s3_ramp_up); + ccprintf("%d\t\t# .s3_ramp_down\n", p->s3_ramp_down); ccprintf("%d\t\t# .new_s0\n", p->new_s0); ccprintf("0x%02x 0x%02x\t# .osc_min (battery, AC)\n", p->osc_min[0], p->osc_min[1]); diff --git a/include/ec_commands.h b/include/ec_commands.h index 477e48fab0..05a7acf781 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -639,7 +639,8 @@ struct lightbar_params { int s0a_tick_delay[2]; /* AC=0/1 */ int s0s3_ramp_down; int s3_sleep_for; - int s3_tick_delay; + int s3_ramp_up; + int s3_ramp_down; /* Oscillation */ uint8_t new_s0; diff --git a/util/ectool.c b/util/ectool.c index 279a370256..80d5d49066 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -1171,7 +1171,8 @@ static int lb_read_params_from_file(const char *filename, READ(1); p->s0a_tick_delay[1] = val[0]; READ(1); p->s0s3_ramp_down = val[0]; READ(1); p->s3_sleep_for = val[0]; - READ(1); p->s3_tick_delay = val[0]; + READ(1); p->s3_ramp_up = val[0]; + READ(1); p->s3_ramp_down = val[0]; READ(1); p->new_s0 = val[0]; READ(2); @@ -1255,7 +1256,8 @@ static void lb_show_params(const struct lightbar_params *p) printf("%d\t\t# .s0a_tick_delay (AC)\n", p->s0a_tick_delay[1]); printf("%d\t\t# .s0s3_ramp_down\n", p->s0s3_ramp_down); printf("%d\t# .s3_sleep_for\n", p->s3_sleep_for); - printf("%d\t\t# .s3_tick_delay\n", p->s3_tick_delay); + printf("%d\t\t# .s3_ramp_up\n", p->s3_ramp_up); + printf("%d\t\t# .s3_ramp_down\n", p->s3_ramp_down); printf("%d\t\t# .new_s0\n", p->new_s0); printf("0x%02x 0x%02x\t# .osc_min (battery, AC)\n", p->osc_min[0], p->osc_min[1]); |