summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2api.h
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2020-09-24 12:06:06 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-14 05:58:49 +0000
commit519c608d2464b5b45b7bfe432a27eae119777971 (patch)
tree9f6053cb0e9b7457c564e7a197cf451958e599ea /firmware/2lib/include/2api.h
parent4e93a487ff99c80777ee80f183193e07bc58c41d (diff)
downloadvboot-519c608d2464b5b45b7bfe432a27eae119777971.tar.gz
vboot/ui: Split disabled_item_mask into two masks for log screen
Add three macros in 2api.h for bitmask operations: - VB2_SET_BIT(mask, index) - VB2_CLR_BIT(mask, index) - VB2_GET_BIT(mask, index) These macros will be used in corresponding depthcharge CLs. Split disabled_item_mask into: - disabled_item_mask: Disabled style, but still visible and selectable. - hidden_item_mask: Not visible. Ignore selecting on disabled menu items. Set appropriate disabled_item_mask for page up/down buttons in log screen. Revise tests of hidden_item_mask and add unit tests of disabled_item_mask. BUG=b:163301076, b:146399181 BRANCH=none TEST=CC=x86_64-pc-linux-gnu-clang; make clean && make runtests TEST=CC=x86_64-pc-linux-gnu-clang; DETACHABLE=1; make clean && make runtests TEST=CC=x86_64-pc-linux-gnu-clang; PHYSICAL_PRESENCE_KEYBOARD=1; make clean && make runtests TEST=CC=x86_64-pc-linux-gnu-clang; DIAGNOSTIC_UI=1; make clean && make runtests TEST=Build locally, navigate to debug info screen with <TAB>, select page up or page down, and observe that nothing happens. Cq-Depend: chromium:2432168 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I1607af53f6e2b5c1cde568cb24606314051d2380 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2426154 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r--firmware/2lib/include/2api.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 67b5074a..b4dfadf8 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -1293,6 +1293,11 @@ vb2_error_t vb2ex_ec_battery_cutoff(void);
/*****************************************************************************/
/* Functions for UI display. */
+/* Helpers for bitmask operations */
+#define VB2_SET_BIT(mask, index) ((mask) |= ((uint32_t)1 << (index)))
+#define VB2_CLR_BIT(mask, index) ((mask) &= ~((uint32_t)1 << (index)))
+#define VB2_GET_BIT(mask, index) ((mask) & ((uint32_t)1 << (index)))
+
/* Screens. */
enum vb2_screen {
/* Blank screen */
@@ -1375,6 +1380,12 @@ enum vb2_ui_error {
* doesn't have a menu, this value will be ignored.
* @param disabled_item_mask Mask for disabled menu items. Bit (1 << idx)
* indicates whether item 'idx' is disabled.
+ * A disabled menu item is visible and selectable,
+ * with a different button style.
+ * @param hidden_item_mask Mask for hidden menu items. Bit (1 << idx)
+ * indicates whether item 'idx' is hidden.
+ * A hidden menu item is neither visible nor
+ * selectable.
* @param timer_disabled Whether timer is disabled or not. Some screen
* descriptions will depend on this value.
* @param current_page Current page number for a log screen. If the
@@ -1387,6 +1398,7 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen,
uint32_t locale_id,
uint32_t selected_item,
uint32_t disabled_item_mask,
+ uint32_t hidden_item_mask,
int timer_disabled,
uint32_t current_page,
enum vb2_ui_error error_code);