Commit Graph

11 Commits

Author SHA1 Message Date
Bill Richardson
e55bac2214 Improve EC console messages for lightbar stuff
I need more information to find the source of some problems. This
just adds a little more context to the lightbar console messages.

BUG=chrome-os-partner:33401
BRANCH=ToT,samus
TEST=make buildall -j

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I97a210754833c9384eae517f9df2e97d3a9ea6b4
Reviewed-on: https://chromium-review.googlesource.com/231136
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-11-21 06:23:16 +00:00
Bill Richardson
87762fa699 Add compiler/decompiler for lightbar bytecode programs.
BUG=none
BRANCH=ToT
TEST=manual

  make BOARD=samus
  for i in extra/lightbar/programs/[g-z]*.bin; do
    ./build/samus/util/lbcc -d $i /tmp/x.lbs
    ./build/samus/util/lbcc /tmp/x.lbs /tmp/x.bin
    cmp $i /tmp/x.bin
  done

Change-Id: I86c014c425e917ecafadd1c6845fcf2e5b4edbb7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220244
2014-09-30 01:53:53 +00:00
Bill Richardson
b88866828f 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>
2014-09-26 09:21:06 +00:00
Bill Richardson
c46f569a39 Add standalone lightbar simulation tool
This adds an "extra/" directory to hold various experiments and optional
programs. With this change, we add a tool that can simulate the lightbar
behavior on the build machine. That can be used to experment with variations
in the lightbar pattern code without needing to reflash a Pixel with a new
EC to see the effect.

There is no functional change to the EC code, just a couple of #ifdefs to
allow common/lightbar.c to be compiled separately from the EC.

BUG=none
BRANCH=ToT
TEST=make buildall -j

  cd extra
  make
  ./lightbar

You may need to install the libxcb1-dev package on your build machine.

Change-Id: I847ce7ea97cae792b1de1b91f488819e873b6555
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199883
2014-05-15 05:20:14 +00:00
Randall Spangler
b0891c30e0 Cleanup: move lightbar command enum into ec_commands.h
Previously this was in lightbar.h.  ec_commands.h should not require
other header files.

Also make brightness local variable static, so it won't leak outside
lightbar module.

This is simply code cleanup; values themselves have not changed.

BUG=none
TEST=if it builds, it's fine
BRANCH=none (not required in link branch since it's just cleanup)

Change-Id: I5722fb677fcec99e0826e3dfc0b22033781b576f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32815
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-09-11 09:46:16 -07:00
Bill Richardson
ede77d7cac Add "lightbar demo" mode for executive bikeshedding
I keep getting asked to build an EC image to manually control the lightbar
patterns so that the Powers That Be can look at it. This change just makes
it possible to turn that mode on and off for yourself. You'll need a root
shell or the EC console to do it, though.

BUG=chrome-os-partner:8039
BRANCH=link
TEST=manual

From the EC console, type

  lightbar demo 1

OR from the root shell run

  ectool lightbar demo 1

After that, these keys should change the lightbar appearance (transitions
may be slow and subtle - that's intended):

  UP = battery is more fully charged
  DOWN = battery is less fully charged
  RIGHT = battery is charging
  LEFT = battery is discharging
  BRIGHT = increase lightbar brightness
  DIM = decrase lightbar brightness

Note that this does not interfere with the normal function of any keys. It
only adds some additional EC behavior.

Change-Id: Ia1a9855188244d74b670f9dbfdf60e3ac0343460
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30899
2012-08-20 15:44:50 -07:00
Bill Richardson
468bc6171c Add LPC lightbar command to get the current sequence.
Instead of making the STOP command synchronous, we can just have the
host-side app tell the EC to stop, then poll until it has.

BUG=chrome-os-partner:9349
TEST=manual

"make BOARD=link", then
copy build/link/util/lbplay to the host and run it.

Change-Id: I846924ae7994a498e0089197785cf239898fe2a3
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-08 12:03:49 -07:00
Bill Richardson
e763812a3a Give ectool the same lightbar commands as the console.
BUG=chrome-os-partner:7839
TEST=manual

Try "lightbar help" on the EC console and "ectool lightbar help" on the
host. You should see the same commands and behavior.

Change-Id: I6e879e8bb892ef5ada7ef85a97fdf243149f4cb6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-25 18:42:36 -07:00
Bill Richardson
b4ac7cf558 Clean up lightbar msg command parsing, add some help.
BUG=none
TEST=none

Change-Id: I5767bd45bd66793606014b3ce8020d0eb2e17090
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-25 09:30:20 -07:00
Bill Richardson
49de2279d1 Tweaks to lightbar code, detect konami sequence
More cleanup to come...

BUG=chrome-os-partner:7839
TEST=manual

Lights should blink in various ways, depending on the CPU state.

Also try the konami code on the keyboard.

Change-Id: I90be9aabb611278ed509493fbab4d5faff74e24c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-19 12:44:43 -07:00
Bill Richardson
d86ad99165 Add preliminary lightbar functionality.
I need to clean up the console commands and provide the same functionality
via ectool, but this is a good starting point.

BUG=chrome-os-partner:7839
TEST=manual

Power up the CPU. The lights should blink.

Change-Id: Ic05a171d2b647551f1cfc7d6b2fd101088cac137
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-12 13:40:09 -07:00