altos: Make task list output more useful
authorKeith Packard <keithp@keithp.com>
Wed, 29 Jun 2016 19:54:31 +0000 (12:54 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 30 Jun 2016 02:17:45 +0000 (19:17 -0700)
Add the timeout value and task id

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_task.c

index 0a790ccd1e44c18c1d69715b3bc8ee3e800730bc..cf0b58ed8eaa0bf939e0e77bc80635b69f6f52db 100644 (file)
@@ -537,12 +537,15 @@ ao_task_info(void)
 {
        uint8_t         i;
        __xdata struct ao_task *task;
+       uint16_t        now = ao_time();
 
        for (i = 0; i < ao_num_tasks; i++) {
                task = ao_tasks[i];
-               printf("%12s: wchan %04x\n",
-                      task->name,
-                      (int) task->wchan);
+               printf("%2d: wchan %08x alarm %5d %s\n",
+                      task->task_id,
+                      (int) task->wchan,
+                      task->alarm ? (int16_t) (task->alarm - now) : 9999,
+                      task->name);
        }
 #if HAS_TASK_QUEUE && DEBUG
        ao_task_validate();