# HG changeset patch # User Michael Spacefalcon # Date 1403501593 0 # Node ID 103b06ef644ae336bbdd018c51192bcf9c5fa5fe # Parent 6e54a3fb01b9a73a63e657156a93c20266620bee os_tim_fl.c: os_TimInit() done diff -r 6e54a3fb01b9 -r 103b06ef644a gsm-fw/gpf/osl/os_tim_fl.c --- a/gsm-fw/gpf/osl/os_tim_fl.c Mon Jun 23 04:53:10 2014 +0000 +++ b/gsm-fw/gpf/osl/os_tim_fl.c Mon Jun 23 05:33:13 2014 +0000 @@ -19,7 +19,7 @@ extern T_OS_TIMER_ENTRY TimerTable[]; extern T_OS_TIMER_TABLE_ENTRY *p_list[]; -extern void os_Timeout(unsigned t_handle); +extern void os_Timeout(UNSIGNED t_handle); extern void timer_error(int err); unsigned os_time_to_tick_multiplier = TIME_TO_TICK_TDMA_FRAME_MULTIPLIER; @@ -65,3 +65,33 @@ t_info_read = 1; return(OS_OK); } + +GLOBAL LONG +os_TimInit(void) +{ + int i; + + if (NU_Create_Semaphore(&TimSemCB, "TIMSEM", 1, NU_PRIORITY) + != NU_SUCCESS) + return(OS_ERROR); + if (NU_Create_Timer(&os_timer_cb, "OS_TIMER", os_Timeout, 0, 1, 0, + NU_DISABLE_TIMER) != NU_SUCCESS) + return(OS_ERROR); + used_timers = 0; + max_used_timers = 0; + next_t_handle = 1; + t_list_access = 0; + t_start_ticks = 0; + p_list[0] = 0; + for (i = 1; i < MaxSimultaneousTimer; i++) { + TimerTable[i].entry.status = 0; + TimerTable[i].entry.next = 0; + TimerTable[i].entry.prev = 0; + TimerTable[i].next_t_handle = i + 1; + p_list[i] = 0; + } + TimerTable[MaxSimultaneousTimer].entry.status = 0; + TimerTable[MaxSimultaneousTimer].next_t_handle = 0; + t_running = 0; + return(OS_OK); +}