Files
OpenCellular/extra/lightbar
Eric Caruso 748848e8a2 lightbar: test programs for seq type PROGRAM
These programs test various bytecode interpreter functions.
rainbow-shift, red-green-blink and green-pulse produce visual
effects, whereas the other three programs test error cases.

bad-jump makes sure the interpreter stops if the PC goes
out of bounds. bad-opcode makes sure the interpreter stops if it
does not understand the instructions it is decoding.
infinite-jump makes sure that sticking a tight loop in the EC
(i.e., one not perforated with any DELAYs, RAMP_ONCEs, or CYCLE*s)
does not cause it to hang or crash. bad-decode-8 and -32 test that
malformed instructions are detected while decoding the
instruction's immediate data.

BUG=None
BRANCH=ToT
TEST=In simulator/scp files to device and test

Change-Id: I6c189997a13e7c6196daa28eb74d5506b5288f2b
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219565
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-09-26 01:12:45 +00:00
..

Lightbar simulator
------------------------------------------------------------------------------

Build with "make lightbar". The executable is "./lightbar".

You may need to install libxcb1-dev or similar.

This provides a simulation environment for the lightbar task, compiling
common/lightbar.c from the EC source, but faking the rest of the EC.

The EC console is on stdin/stdout, delivering all input to the lightbar's
console command handler (so it prefixes any input with "lightbar"). The
lightbar itself is displayed in an X window. You can click in that window to
emulate changes to the battery level, AC connection, and brightness, all of
which are normally outside the lightbar task's direct control.

The initial sequence is "S5". Try issuing the command "seq s3s0" to see
something more familiar.


Note: the Pixel lightbar circuitry has three modes of operation:

Unpowered

  When the host CPU is off (S5/G3), all power to the lightbar and its
  controller circuitry is lost.

On

  When the host CPU is on (S0) or suspended (S3), the lightbar is powered
  again. After every power loss, it will need to be reinitialized by calling
  lb_init() before it can be used.

Standby

  The lightbar controller ICs can turn off all the LED outputs to conserve
  power. This is the initial state when power is applied. You can turn the
  LEDs off manually by calling lb_off(). When suspended, the controller will
  respond to commands, but the LEDs aren't lit. Turn them on with lb_on().