changeset 471:c8b5a8e84ef7

os_tim_ir.c: os_CreateTimer(): minor fixes
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 26 Jun 2014 07:13:41 +0000
parents 81b941dd415d
children 6adbacc0f255
files gsm-fw/gpf/osl/os_tim_ir.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_tim_ir.c	Thu Jun 26 06:41:54 2014 +0000
+++ b/gsm-fw/gpf/osl/os_tim_ir.c	Thu Jun 26 07:13:41 2014 +0000
@@ -286,19 +286,17 @@
 	return OS_OK;
 }
 
-/* FIXME: TaskHandle and MemPoolHandle are unused?! */
 GLOBAL LONG os_CreateTimer(OS_HANDLE TaskHandle,
 			   void (*TimeoutProc) (OS_HANDLE, OS_HANDLE, USHORT),
 			   OS_HANDLE *TimerHandle, OS_HANDLE MemPoolHandle)
+	/* TaskHandle and MemPoolHandle arguments are unused */
 {
 	STATUS sts;
-	OS_HANDLE orig_next_t_handle;
 	T_OS_TIMER_ENTRY *timer_e;
 
 	t_list_access = 1;
 	sts = NU_Obtain_Semaphore(&TimSemCB, NU_SUSPEND);
-	orig_next_t_handle = next_t_handle;
-	if (next_t_handle == 0) { /* INVALID_HANDLE */
+	if (next_t_handle == 0) { /* no free timers left */
 		if (sts == NU_SUCCESS)
 			NU_Release_Semaphore(&TimSemCB);
 		t_list_access = 0;
@@ -308,7 +306,7 @@
 	timer_e = &TimerTable[next_t_handle];
 	timer_e->entry.status = 1;
 	timer_e->entry.TimeoutProc = TimeoutProc;
-	*TimerHandle = orig_next_t_handle;
+	*TimerHandle = next_t_handle;
 	next_t_handle = timer_e->next_t_handle;
 	used_timers++;
 	if (max_used_timers < used_timers)