diff options
author | Eric Caruso <ejcaruso@chromium.org> | 2014-10-01 10:30:00 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-01 22:42:30 +0000 |
commit | d3ebcb18caabe9eb96383fa33edd501061bae7e0 (patch) | |
tree | 404ef06ce79cffecee58b7592a93391d6963ecab | |
parent | 786a45347d0573b6bc216251b384d733f86a9ad0 (diff) | |
download | chrome-ec-d3ebcb18caabe9eb96383fa33edd501061bae7e0.tar.gz |
lightbar: hide program command over console
This doesn't make any sense to expose to the console, so we can
save some logic and string literals by only compiling it for the
simulator.
BUG=chrome-os-partner:32203
BRANCH=ToT
TEST=Checked console does not support command. ectool still
works and the lightbar simulator still has the command.
Change-Id: Ib216c7c11fd3d0d2d444ef7fc0dda4e451103219
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220834
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | common/lightbar.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index f67e7f174c..fc11b951bc 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -1539,7 +1539,9 @@ static int help(const char *cmd) ccprintf(" %s LED - get current LED color\n", cmd); ccprintf(" %s demo [0|1] - turn demo mode on & off\n", cmd); ccprintf(" %s params - show current params\n", cmd); +#ifdef LIGHTBAR_SIMULATION ccprintf(" %s program filename - load lightbyte program\n", cmd); +#endif ccprintf(" %s version - show current version\n", cmd); return EC_SUCCESS; } @@ -1711,14 +1713,11 @@ static int command_lightbar(int argc, char **argv) return EC_SUCCESS; } - if (argc >= 3 && !strcasecmp(argv[1], "program")) { #ifdef LIGHTBAR_SIMULATION + if (argc >= 3 && !strcasecmp(argv[1], "program")) { return lb_load_program(argv[2], &next_prog); -#else - ccprintf("can't load program from console\n"); - return EC_ERROR_INVAL; -#endif } +#endif if (argc == 4) { struct ec_params_lightbar in; |