diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-05-24 12:13:36 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-24 22:07:15 -0700 |
commit | abb8be8b64e3341e49dfc3be031a7e372126f37b (patch) | |
tree | 2095c362cafaf42dc82647ee2071aa110d95b89a /include/host_command.h | |
parent | 8e60deda9d38476714ea70cc15cfaecd7fad1ee1 (diff) | |
download | chrome-ec-abb8be8b64e3341e49dfc3be031a7e372126f37b.tar.gz |
host_command: Add host_is_event_set
host_is_event_set checks whether a given event is set or not.
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: I7207fa75d155d5b9adc50430bc1ed703bea7c1b9
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/514208
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/host_command.h')
-rw-r--r-- | include/host_command.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/host_command.h b/include/host_command.h index aff1d1b8b5..02c9b07915 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -161,6 +161,17 @@ void host_clear_events(uint32_t mask); * Return the raw event state. */ uint32_t host_get_events(void); + +/** + * Check a single host event. + * + * @param event Event to check + * @return true if <event> is set or false otherwise + */ +static inline int host_is_event_set(enum host_event_code event) +{ + return host_get_events() & EC_HOST_EVENT_MASK(event); +} #endif /** |