From 9b44097d2399e8305f9b64f6e66c85acd18744f9 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 22 May 2012 10:37:56 -0700 Subject: Add support for printing fixed-point numbers This makes timestamps much easier to read. Signed-off-by: Randall Spangler 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 --- core/cortex-m/task.c | 16 ++++++++-------- core/cortex-m/timer.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'core') diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index d69b607208..3041f431c8 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -492,11 +492,11 @@ void mutex_unlock(struct mutex *mtx) void task_print_list(void) { int i; - ccputs("Task Ready Name Events Time (us)\n"); + ccputs("Task Ready Name Events Time (s)\n"); for (i = 0; i < TASK_ID_COUNT; i++) { char is_ready = (tasks_ready & (1< %10ld us from now\n" + "Deadline: 0x%016lx -> %11.6ld s from now\n" "Active timers:\n", t, deadline, deadline - t); for (tskid = 0; tskid < TASK_ID_COUNT; tskid++) { if (timer_running & (1< %10ld %x\n", tskid, + ccprintf(" Tsk %2d 0x%016lx -> %11.6ld\n", tskid, timer_deadline[tskid].val, - timer_deadline[tskid].val - t, 0xabcd); + timer_deadline[tskid].val - t); if (in_interrupt_context()) uart_emergency_flush(); else @@ -202,7 +202,7 @@ DECLARE_CONSOLE_COMMAND(waitms, command_wait); static int command_get_time(int argc, char **argv) { timestamp_t ts = get_time(); - ccprintf("Time: 0x%016lx = %ld us\n", ts.val, ts.val); + ccprintf("Time: 0x%016lx = %.6ld s\n", ts.val, ts.val); return EC_SUCCESS; } -- cgit v1.2.1