diff options
author | Hsuan Ting Chen <roccochen@chromium.org> | 2020-11-02 18:50:51 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-04 11:49:55 +0000 |
commit | 935e2b9d3fc0dbe67cb93acaa16bac9d49bff894 (patch) | |
tree | 53e339de23b545dec48c12acf03d2f63727c2869 /firmware/2lib | |
parent | f1062d8ad6e596b7e8850e60c8b7f87d8fd84041 (diff) | |
download | vboot-935e2b9d3fc0dbe67cb93acaa16bac9d49bff894.tar.gz |
vboot/ui: Suffix "_ms" to time-related variables
For test/vb2_ui_tests.c:
- Rename mock_get_timer_last to mock_get_timer_last_ms.
- Rename mock_time to mock_time_ms.
- Rename mock_time_start to mock_time_start_ms.
For 2lib/2ui.c and 2lib/2ui_screen.c:
- Rename start_time to start_time_ms in struct vb2_ui_context.
- Rename elapsed to elapsed_ms in developer_mode_action().
BUG=b:156448738
BRANCH=none
TEST=CC=x86_64-pc-linux-gnu-clang;
make clean && make runtests
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: Icabe04003f0dc95f41c9ed8b8e2292f1f64e86bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2513417
Diffstat (limited to 'firmware/2lib')
-rw-r--r-- | firmware/2lib/2ui_screens.c | 14 | ||||
-rw-r--r-- | firmware/2lib/include/2ui.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 29a10625..fecfaa99 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -716,7 +716,7 @@ vb2_error_t developer_mode_init(struct vb2_ui_context *ui) break; } - ui->start_time = vb2ex_mtime(); + ui->start_time_ms = vb2ex_mtime(); return VB2_REQUEST_UI_CONTINUE; } @@ -774,7 +774,7 @@ vb2_error_t vb2_ui_developer_mode_boot_external_action( vb2_error_t developer_mode_action(struct vb2_ui_context *ui) { const int use_short = vb2api_use_short_dev_screen_delay(ui->ctx); - uint64_t elapsed; + uint64_t elapsed_ms; /* TODO(b/159579189): Split this case into a separate root screen */ if (!vb2_dev_boot_allowed(ui->ctx)) @@ -786,24 +786,24 @@ vb2_error_t developer_mode_action(struct vb2_ui_context *ui) if (ui->disable_timer) return VB2_REQUEST_UI_CONTINUE; - elapsed = vb2ex_mtime() - ui->start_time; + elapsed_ms = vb2ex_mtime() - ui->start_time_ms; /* If we're using short delay, wait 2 seconds and don't beep. */ - if (use_short && elapsed > 2 * VB2_MSEC_PER_SEC) { + if (use_short && elapsed_ms > 2 * VB2_MSEC_PER_SEC) { VB2_DEBUG("Booting default target after 2s\n"); ui->disable_timer = 1; return vb2_ui_menu_select(ui); } /* Otherwise, beep at 20 and 20.5 seconds. */ - if ((ui->beep_count == 0 && elapsed > 20 * VB2_MSEC_PER_SEC) || - (ui->beep_count == 1 && elapsed > 20 * VB2_MSEC_PER_SEC + 500)) { + if ((ui->beep_count == 0 && elapsed_ms > 20 * VB2_MSEC_PER_SEC) || + (ui->beep_count == 1 && elapsed_ms > 20 * VB2_MSEC_PER_SEC + 500)) { vb2ex_beep(250, 400); ui->beep_count++; } /* Stop after 30 seconds. */ - if (elapsed > 30 * VB2_MSEC_PER_SEC) { + if (elapsed_ms > 30 * VB2_MSEC_PER_SEC) { VB2_DEBUG("Booting default target after 30s\n"); ui->disable_timer = 1; return vb2_ui_menu_select(ui); diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h index d8c38470..44e24fdd 100644 --- a/firmware/2lib/include/2ui.h +++ b/firmware/2lib/include/2ui.h @@ -99,7 +99,7 @@ struct vb2_ui_context { /* For developer mode. */ int disable_timer; - uint32_t start_time; + uint32_t start_time_ms; int beep_count; /* For manual recovery. */ |