diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-04-03 17:38:16 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2012-04-04 13:14:04 -0700 |
commit | 17fe1ce017143da110b50a3adf19d9fa399a7282 (patch) | |
tree | 5facd7040d2a8cce1ef2856ab77aa4166a6df73f /util | |
parent | afe7cda377573c56052f1020e1cfc54f9f1d7c50 (diff) | |
download | chrome-ec-17fe1ce017143da110b50a3adf19d9fa399a7282.tar.gz |
First "ectool lightbar" command.
BUG=chrome-os-partner:8728
TEST=manual
I don't have a system that has both an EC and a lightsaber, so I can't be
certain this works, but I *think* it will.
I do have a Link proto 0.5. With that, you can say
ectool lightbar test
and the EC console says it's poking at the lightbar, but of course there's
nothing there. If there was, it *should* flash in pretty colors. I have a
lightsaber attached to a BDS, and from the EC console running "lightsaber
test" does make it blink.
Change-Id: Ib6021ad8e53959de52b12efda376254071e5fb4b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c index 5e13902951..dcfe3a375d 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -46,6 +46,10 @@ const char help_str[] = " Erases EC flash\n" " hello\n" " Checks for basic communication with EC\n" + " lightbar reset\n" + " Puts the lightbar into idle mode\n" + " lightbar test [NUM]\n" + " Cycles lights once. Optional argument does nothing.\n" " pstoreinfo\n" " Prints information on the EC host persistent storage\n" " pstoreread <offset> <size> <outfile>\n" @@ -793,6 +797,33 @@ int cmd_pwm_set_keyboard_backlight(int argc, char *argv[]) return 0; } +int cmd_lightbar(int argc, char *argv[]) +{ + struct lpc_params_lightbar_test p; + char *e; + + p.tbd = 0; + + if (argc) { + if (!strcmp("reset", argv[0])) { + return ec_command(EC_LPC_COMMAND_LIGHTBAR_RESET, + NULL, 0, NULL, 0); + } else if (!strcmp("test", argv[0])) { + if (argc > 1) { + p.tbd = strtol(argv[1], &e, 0); + if (e && *e) { + fprintf(stderr, "Bad arg\n"); + return -1; + } + } + return ec_command(EC_LPC_COMMAND_LIGHTBAR_TEST, + &p, sizeof(p), NULL, 0); + } + } + + printf("Usage: lightbar reset | test [NUM]\n"); + return -1; +} int cmd_usb_charge_set_mode(int argc, char *argv[]) { @@ -1211,6 +1242,7 @@ const struct command commands[] = { {"flashwrite", cmd_flash_write}, {"flashinfo", cmd_flash_info}, {"hello", cmd_hello}, + {"lightbar", cmd_lightbar}, {"pstoreinfo", cmd_pstore_info}, {"pstoreread", cmd_pstore_read}, {"pstorewrite", cmd_pstore_write}, |