diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-07-08 15:16:42 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-15 18:48:19 +0000 |
commit | 171fe207e672191cc9dbec722999e24d81798f16 (patch) | |
tree | c169a841daaaf6dddc605a1abc42a489a32e5c3e /common/port80.c | |
parent | 8c001c5ab9b1216bfbc2b7f50f1f6fa95a225f7a (diff) | |
download | chrome-ec-171fe207e672191cc9dbec722999e24d81798f16.tar.gz |
tree: Replace %pT with snprintf_timestamp
Using standard format specifiers makes it easier to switch between the
"builtin" EC standard library and the C standard library provided by the
toolchain (or Zephyr).
BRANCH=none
BUG=b:238433667, b:234181908
TEST=On icetower v0.1 with servo_micro and J-Trace attached:
> reboot
observe console shows timestamps
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I6660ff22ebc6ba74f1245ff83026f5919b356a02
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3756178
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'common/port80.c')
-rw-r--r-- | common/port80.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/port80.c b/common/port80.c index c7c9d714ff..66ad48be5e 100644 --- a/common/port80.c +++ b/common/port80.c @@ -11,6 +11,7 @@ #include "hooks.h" #include "host_command.h" #include "port80.h" +#include "printf.h" #include "task.h" #include "timer.h" #include "util.h" @@ -39,6 +40,8 @@ DECLARE_DEFERRED(port80_dump_buffer); void port_80_write(int data) { + char ts_str[PRINTF_TIMESTAMP_BUF_SIZE]; + /* * By default print_in_int is disabled if: * 1. CONFIG_BRINGUP is not defined @@ -53,9 +56,11 @@ void port_80_write(int data) * dump the current port80 buffer to EC console. This is to allow * developers to help debug BIOS progress by tracing port80 messages. */ - if (print_in_int) - CPRINTF("%c[%pT Port 80: 0x%02x]", scroll ? '\n' : '\r', - PRINTF_TIMESTAMP_NOW, data); + if (print_in_int) { + snprintf_timestamp_now(ts_str, sizeof(ts_str)); + CPRINTF("%c[%s Port 80: 0x%02x]", scroll ? '\n' : '\r', ts_str, + data); + } hook_call_deferred(&port80_dump_buffer_data, 4 * SECOND); |