FreeCalypso > hg > freecalypso-sw
changeset 481:5639b4fa8672
os_tim_{fl,ir}.c: use TMR_* constant definitions
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 29 Jun 2014 04:06:24 +0000 |
parents | 334a3381f569 |
children | 9d80090a9e0c |
files | gsm-fw/gpf/osl/os_tim_fl.c gsm-fw/gpf/osl/os_tim_ir.c |
diffstat | 2 files changed, 15 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_tim_fl.c Sun Jun 29 03:27:23 2014 +0000 +++ b/gsm-fw/gpf/osl/os_tim_fl.c Sun Jun 29 04:06:24 2014 +0000 @@ -84,13 +84,13 @@ t_start_ticks = 0; p_list[0] = 0; for (i = 1; i < MaxSimultaneousTimer; i++) { - TimerTable[i].entry.status = 0; + TimerTable[i].entry.status = TMR_FREE; 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].entry.status = TMR_FREE; TimerTable[MaxSimultaneousTimer].next_t_handle = 0; t_running = 0; return(OS_OK);
--- a/gsm-fw/gpf/osl/os_tim_ir.c Sun Jun 29 03:27:23 2014 +0000 +++ b/gsm-fw/gpf/osl/os_tim_ir.c Sun Jun 29 04:06:24 2014 +0000 @@ -70,7 +70,7 @@ task_handle = timer->task_handle; e_handle = timer->entity_handle; t_index = timer->t_index; - timer->status = 1; + timer->status = TMR_USED; if (timer->next == timer) { t_running = NULL; done = 1; @@ -139,8 +139,8 @@ } timer->next = NULL; timer->prev = NULL; - timer->status = 1; - return 1; + timer->status = TMR_USED; + return TMR_USED; } static unsigned @@ -192,7 +192,7 @@ t_running = timer; return_ticks = ticks; } - timer->status = 2; + timer->status = TMR_ACTIVE; return return_ticks; } @@ -207,7 +207,7 @@ t_list_access = 1; timer = &TimerTable[TimerHandle].entry; - if (TimerHandle > MaxSimultaneousTimer || timer->status == 0) { + if (TimerHandle > MaxSimultaneousTimer || timer->status == TMR_FREE) { t_list_access = 0; return OS_ERROR; } @@ -218,7 +218,7 @@ os_MyHandle(); */ status = timer->status; - if (status == 2) + if (status == TMR_ACTIVE) status = os_remove_timer_from_list(timer); timer->t_handle = TimerHandle; timer->task_handle = os_MyHandle(); @@ -243,12 +243,13 @@ t_list_access = 1; timer_e = &TimerTable[TimerHandle]; - if (TimerHandle > MaxSimultaneousTimer || timer_e->entry.status == 0) { + if (TimerHandle > MaxSimultaneousTimer || + timer_e->entry.status == TMR_FREE) { t_list_access = 0; return OS_ERROR; } sts = NU_Obtain_Semaphore(&TimSemCB, NU_SUSPEND); - if (timer_e->entry.status == 2) + if (timer_e->entry.status == TMR_ACTIVE) os_remove_timer_from_list(&timer_e->entry); if (sts == NU_SUCCESS) NU_Release_Semaphore(&TimSemCB); @@ -270,7 +271,8 @@ t_list_access = 1; sts = NU_Obtain_Semaphore(&TimSemCB, NU_SUSPEND); timer_e = &TimerTable[TimerHandle]; - if (TimerHandle > MaxSimultaneousTimer || timer_e->entry.status == 0) { + if (TimerHandle > MaxSimultaneousTimer || + timer_e->entry.status == TMR_FREE) { if (sts == NU_SUCCESS) NU_Release_Semaphore(&TimSemCB); t_list_access = 0; @@ -278,7 +280,7 @@ } timer_e->next_t_handle = next_t_handle; next_t_handle = TimerHandle; - timer_e->entry.status = 0; + timer_e->entry.status = TMR_FREE; used_timers--; t_list_access = 0; if (sts == NU_SUCCESS) @@ -304,7 +306,7 @@ } timer_e = &TimerTable[next_t_handle]; - timer_e->entry.status = 1; + timer_e->entry.status = TMR_USED; timer_e->entry.TimeoutProc = TimeoutProc; *TimerHandle = next_t_handle; next_t_handle = timer_e->next_t_handle;