X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_task.c;h=e8a092aaf660fcf6bbec48706e14d2f7936e297b;hb=1934468e96ea9d179abf6e3e728b6b14ce793f46;hp=47352fc104afde937559c9ee2a31060447c62c95;hpb=658d8be170f9aea683fe62b68368736a177411a5;p=fw%2Faltos diff --git a/src/kernel/ao_task.c b/src/kernel/ao_task.c index 47352fc1..e8a092aa 100644 --- a/src/kernel/ao_task.c +++ b/src/kernel/ao_task.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -504,6 +505,8 @@ static __xdata uint8_t ao_forever; void ao_delay(uint16_t ticks) { + if (!ticks) + ticks = 1; ao_sleep_for(&ao_forever, ticks); } @@ -535,12 +538,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();