FreeCalypso > hg > freecalypso-sw
changeset 465:d5cf423dad3a
os_tim_ir.c: os_Timeout() fixed
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 26 Jun 2014 04:46:53 +0000 |
parents | 14d2a7f473c3 |
children | d43bf2d301de |
files | gsm-fw/gpf/osl/os_tim_ir.c |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_tim_ir.c Thu Jun 26 03:23:29 2014 +0000 +++ b/gsm-fw/gpf/osl/os_tim_ir.c Thu Jun 26 04:46:53 2014 +0000 @@ -38,17 +38,17 @@ * The code passes gcc, but some polish is still likely needed. */ -/* FIXME: t_handle is unused?! */ -void os_Timeout(UNSIGNED t_handle) +void +os_Timeout(UNSIGNED t_handle) /* argument is unused */ { - UNSIGNED s_ticks; - OS_HANDLE task_handle; - OS_HANDLE e_handle; - int t_index, i, done; + ULONG s_ticks; + OS_HANDLE task_handle, e_handle; + USHORT t_index; + int i, done; T_OS_TIMER_TABLE_ENTRY **t_r4; T_OS_TIMER_TABLE_ENTRY *timer; void (*timeout_func) (OS_HANDLE, OS_HANDLE, USHORT); - OS_TIME InitialTime; + OS_TIME resched_time; if (t_list_access) { t_start_ticks++; @@ -59,7 +59,7 @@ t_list_access = 1; timer = t_running; - if (t_running) { + if (timer) { s_ticks = 0; done = 0; i = 0; @@ -79,12 +79,12 @@ timer->next->prev = timer->prev; if (timer->next->r_ticks) { t_running = timer->next; - s_ticks = timer->r_ticks; + s_ticks = timer->next->r_ticks; done = 1; } else timer = timer->next; } - /* FIXME: IND$CALL() ? */ + timeout_func(task_handle, e_handle, t_index); } while (!done); @@ -96,9 +96,9 @@ } for (t_r4 = p_list; *t_r4; t_r4++) { timer = *t_r4; - InitialTime = SYSTEM_TICKS_TO_TIME(timer->p_ticks); + resched_time = SYSTEM_TICKS_TO_TIME(timer->p_ticks); os_StartTimer(timer->entity_handle, timer->t_handle, - timer->t_index, InitialTime, InitialTime); + timer->t_index, resched_time, resched_time); *t_r4 = NULL; }