diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-08-05 02:26:44 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-08 13:53:28 -0700 |
commit | 1e7b5f3c071d219df2866004980662622ea810d8 (patch) | |
tree | 8ecd947ff5654399aa3a21983fb707d525d1fde4 /common/lid_switch.c | |
parent | 49dbc8a8aae9cc929de5a5b488b2e60bf5b7bf93 (diff) | |
download | chrome-ec-1e7b5f3c071d219df2866004980662622ea810d8.tar.gz |
lid_switch: Add console command to get virtual lid state
BUG=chrome-os-partner:55975
BRANCH=None
TEST=Manual on kevin, verify "lidstate" on console prints open / closed
based upon state of lid.
Change-Id: I76f1b63a536f76aee7b248fefdd17436773a6716
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/366710
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/lid_switch.c')
-rw-r--r-- | common/lid_switch.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/lid_switch.c b/common/lid_switch.c index f5af903936..e44925ee5a 100644 --- a/common/lid_switch.c +++ b/common/lid_switch.c @@ -136,6 +136,17 @@ DECLARE_CONSOLE_COMMAND(lidclose, command_lidclose, "Simulate lid close", NULL); +static int command_lidstate(int argc, char **argv) +{ + ccprintf("lid state: %s\n", debounced_lid_open ? "open" : "closed"); + + return EC_SUCCESS; +} +DECLARE_CONSOLE_COMMAND(lidstate, command_lidstate, + NULL, + "Get state of lid", + NULL); + /** * Host command to enable/disable lid opened. */ |