summaryrefslogtreecommitdiff
path: root/include/lightbar.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesstabilize-quickfix-15278.72.B-ishstabilize-quickfix-15183.78.B-ishstabilize-15446.B-ishstabilize-15439.B-ishstabilize-15432.B-ishstabilize-15429.B-ishstabilize-15415.B-ishstabilize-15395.B-ishstabilize-15393.48.B-ishstabilize-15381.B-ishstabilize-15364.B-ishstabilize-15361.B-ishstabilize-15359.B-ishstabilize-15359.58.B-ishstabilize-15359.50.B-ishstabilize-15359.45.B-ishstabilize-15335.B-ishstabilize-15329.59.B-ishstabilize-15329.44.B-ishstabilize-15317.B-ishstabilize-15301.B-ishstabilize-15300.B-ishstabilize-15278.64.B-ishstabilize-15251.B-ishstabilize-15245.B-ishstabilize-15236.66.B-ishstabilize-15208.B-ishstabilize-15207.B-ishstabilize-15185.B-ishstabilize-15185.7.B-ishstabilize-15183.82.B-ishstabilize-15183.69.B-ishstabilize-15183.14.B-ishstabilize-15174.B-ishstabilize-15167.B-ishstabilize-15129.B-ishstabilize-15122.B-ishstabilize-15120.B-ishstabilize-15117.86.B-ishstabilize-15117.48.B-ishstabilize-15117.111.B-ishrelease-R114-15437.B-ishrelease-R113-15393.B-ishrelease-R112-15359.B-ishrelease-R111-15329.B-ishrelease-R110-15278.B-ishrelease-R109-15237.B-ishrelease-R109-15236.B-ishrelease-R108-15183.B-ishrelease-R107-15117.B-ishishfirmware-ti50-prepvt-15315.B-ishfirmware-skyrim-15390.B-ishfirmware-skyrim-15369.B-ishfirmware-nissa-15217.B-ishfirmware-nissa-15217.45.B-ishfirmware-nissa-15217.126.B-ishfirmware-duplo-15151.B-ishfirmware-corsola-15194.B-ishfactory-trogdor-15210.B-ishfactory-skyrim-15384.B-ishfactory-nissa-15199.B-ishfactory-corsola-15197.B-ishfactory-corsola-15196.B-ishfactory-brya-15231.B-ishMike Frysinger2022-09-141-1/+1
| | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* common: lightbar: Add histeresis to prevent flickeringGwendal Grignou2015-10-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | When ALS is enabled, if light is around one threshold (say 40 lux), the lightbar will flicker between readings. Add a histeresis to prevent the flickering. The current setting is: setting ^ (dim) 2 | ------+---->---+ 1 | +----<---+--->---+ (bright) 0 | +---<---+--------- +-------+--------+-------+--------> lux 20 40 60 BRANCH=smaug BUG=chrome-os-partner:44400 TEST=check in a dark room (30~40 lux) there is no flickering. Add unit test. Change-Id: I4018e2c2ed764abf9c9ed28e2d50a3e94a7d5f75 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/308205
* common: Add lightbar dimming based on outside light.Gwendal Grignou2015-10-201-0/+18
| | | | | | | | | | | | | | | | Unless the lid is closed, the ALS is used for lightbar dimming. Change the google colors depending on the light sensor result. BUG=chrome-os-partner:44400 BRANCH=smaug TEST=Check all 3 levels of brightness of the lightbar. Check value using "adb shell ectool lightbar" Check double tap color are not affected and is using full brightness. Change-Id: I7b5e2890c3557f1dd3ae719f5f82ffb5fe7b24fb Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/301216 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* Improve EC console messages for lightbar stuffBill Richardson2014-11-211-1/+2
| | | | | | | | | | | | | | 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>
* Add compiler/decompiler for lightbar bytecode programs.Bill Richardson2014-09-301-0/+15
| | | | | | | | | | | | | | | | | 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
* Add demo_tap() function for lightbar demo modeBill Richardson2014-09-261-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* Add standalone lightbar simulation toolBill Richardson2014-05-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Cleanup: move lightbar command enum into ec_commands.hRandall Spangler2012-09-111-15/+0
| | | | | | | | | | | | | | | | | | | | 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>
* Add "lightbar demo" mode for executive bikesheddingBill Richardson2012-08-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add LPC lightbar command to get the current sequence.Bill Richardson2012-05-081-0/+1
| | | | | | | | | | | | | | 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>
* Give ectool the same lightbar commands as the console.Bill Richardson2012-04-251-1/+20
| | | | | | | | | | | 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>
* Clean up lightbar msg command parsing, add some help.Bill Richardson2012-04-251-19/+5
| | | | | | | | BUG=none TEST=none Change-Id: I5767bd45bd66793606014b3ce8020d0eb2e17090 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
* Tweaks to lightbar code, detect konami sequenceBill Richardson2012-04-191-3/+7
| | | | | | | | | | | | | | 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>
* Add preliminary lightbar functionality.Bill Richardson2012-04-121-0/+32
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>