diff options
author | Tristan Honscheid <honscheid@google.com> | 2022-09-01 13:45:04 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-08 22:23:20 +0000 |
commit | 1546ac715b2d5b9b7c9711fe290e52306109f7df (patch) | |
tree | 721a86fdf1ed19136d6299c8fd5eff5cc8b9f96e /include/keyboard_scan.h | |
parent | 38f6076bafcbe25ea8f0fee0d3df0212d0fc480b (diff) | |
download | chrome-ec-1546ac715b2d5b9b7c9711fe290e52306109f7df.tar.gz |
zephyr: tests: Test command `ksstate` in `common/keyboard_scan.c`
Add coverage for the `ksstate` console command
BRANCH=None
BUG=b:244606945
TEST=./twister
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Change-Id: I1dbb754d1a357d162baee1bb909b37b7321b5c4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872725
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'include/keyboard_scan.h')
-rw-r--r-- | include/keyboard_scan.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h index 3ce1f74745..9bde457ef3 100644 --- a/include/keyboard_scan.h +++ b/include/keyboard_scan.h @@ -183,4 +183,27 @@ struct keyboard_type { extern struct keyboard_type key_typ; #endif +#ifdef TEST_BUILD +/** + * @brief Get the value of print_state_changes + * + * @return non-zero if state change printing is enabled, zero if not. + */ +__test_only int keyboard_scan_get_print_state_changes(void); + +/** + * @brief Forcibly set the value of print_state_changes + * + * @param val Value to set + */ +__test_only void keyboard_scan_set_print_state_changes(int val); + +/** + * @brief Checks if keyboard scanning is currently enabled. + * + * @return int non-zero if enabled, zero otherwise. + */ +int keyboard_scan_is_enabled(void); +#endif /* TEST_BUILD */ + #endif /* __CROS_EC_KEYBOARD_SCAN_H */ |