summaryrefslogtreecommitdiff
path: root/include/uart.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-22 10:37:56 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-22 10:37:56 -0700
commit9b44097d2399e8305f9b64f6e66c85acd18744f9 (patch)
treec89d56cdfbe2a732b290434037d76b8492d900af /include/uart.h
parent15854fa680c57cfd49f30cf265a2a4d4bb67b076 (diff)
downloadchrome-ec-9b44097d2399e8305f9b64f6e66c85acd18744f9.tar.gz
Add support for printing fixed-point numbers
This makes timestamps much easier to read. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9866 TEST=timerinfo, taskinfo, battery commands have fixed-point numbers, and timestamps printed in the log look right. Change-Id: If91c83f725984c8e04bfb7cdcff316d9c3bfe24c
Diffstat (limited to 'include/uart.h')
-rw-r--r--include/uart.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/uart.h b/include/uart.h
index 17922879bc..f71d151c76 100644
--- a/include/uart.h
+++ b/include/uart.h
@@ -50,10 +50,14 @@ int uart_puts(const char *outstr);
* int64_t / uint64_t (%ld / %lu / %lx)
* pointer (%p)
* And the following special format codes:
- * current time in us (%T)
+ * current time in sec (%T) - interpreted as "%.6T" for fixed-point format
* including padding (%-5s, %8d, %08x, %016lx)
*
- * Floating point output (%f / %g) is not supported. */
+ * Floating point output (%f / %g) is not supported, but there is a fixed-point
+ * extension for integers; a padding option of .N (where N is a number) will
+ * put a decimal before that many digits. For example, printing 123 with
+ * format code %.6d will result in "0.000123". This is most useful for
+ * printing times, voltages, and currents. */
int uart_printf(const char *format, ...);
/* Print formatted output to the UART, like vprintf(). Supports the same