FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/gpf/frame/vsi_tim.c @ 535:30f2e994fcb0
gsm-fw/L1/include/l1_macro.h: #include lines preened
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 02 Aug 2014 01:15:25 +0000 |
parents | 2c760f6b1fe0 |
children |
rev | line source |
---|---|
316
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +------------------------------------------------------------------------------ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | File: vsi_tim.c |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 +------------------------------------------------------------------------------ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 | Copyright 2002 Texas Instruments Berlin, AG |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | All rights reserved. |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 | This file is confidential and a trade secret of Texas |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 | Instruments Berlin, AG |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 | The receipt of or possession of this file does not convey |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 | any rights to reproduce or disclose its contents or to |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 | manufacture, use, or sell anything it may describe, in |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 | whole, or in part, without the specific written consent of |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 | Texas Instruments Berlin, AG. |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 +----------------------------------------------------------------------------- |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 | Purpose : This Module defines the virtual system interface part |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 | for the timer handling. |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 +----------------------------------------------------------------------------- |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 #ifndef __VSI_TIM_C__ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 #define __VSI_TIM_C__ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 /*==== INCLUDES ===================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 |
319
2c760f6b1fe0
gsm-fw/gpf/frame: everything compiles except vsi_trc.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
316
diff
changeset
|
27 #include <string.h> |
2c760f6b1fe0
gsm-fw/gpf/frame: everything compiles except vsi_trc.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
316
diff
changeset
|
28 |
2c760f6b1fe0
gsm-fw/gpf/frame: everything compiles except vsi_trc.c
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
316
diff
changeset
|
29 #include "gpfconf.h" |
316
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 #include "typedefs.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #include "vsi.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 #include "os.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 #include "tools.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 #include "frm_defs.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 #include "frm_types.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 #include "frm_glob.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 #include "frame.h" |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 /*==== TYPES ======================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 typedef struct _T_TIMER_CONFIG_ENTRY |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 T_HANDLE entity; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 T_TIME value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 USHORT index; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 USHORT mode; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 struct _T_TIMER_CONFIG_ENTRY *next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 } T_TIMER_CONFIG_ENTRY; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 /*==== CONSTANTS ==================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 LOCAL const T_STR_IND StrInd[] = |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 "TIMER_SET", TIMER_SET, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 "TIMER_RESET", TIMER_RESET, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 "TIMER_SPEED_UP", TIMER_SPEED_UP, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 "TIMER_SLOW_DOWN", TIMER_SLOW_DOWN, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 "TIMER_SUPPRESS", TIMER_SUPPRESS, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 "TIMER_CLEAN", TIMER_CLEAN, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 NULL, 0 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 }; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 /*==== EXTERNALS ==================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 /* -------------- S H A R E D - BEGIN ---------------- */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 #ifdef _TOOLS_ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 #pragma data_seg("FRAME_SHARED") |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 extern OS_HANDLE ext_data_pool_handle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 extern T_HANDLE TimerHandleField[]; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 /*==== VARIABLES ==================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 char timer_configured; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 T_TIMER_CONFIG_ENTRY *t_config; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 #else |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 extern char timer_configured; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 extern T_TIMER_CONFIG_ENTRY *t_config; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 #ifdef _TOOLS_ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 #pragma data_seg() |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 /* -------------- S H A R E D - END ---------------- */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 /*==== FUNCTIONS ==================================================*/ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 int GetTimerStartValue ( T_HANDLE Caller, USHORT TimerIndex, T_TIME OrgValue, T_TIME *NewValue ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 #ifndef RUN_FLASH |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 | STATE : code ROUTINE : GetTimerStartValue | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 PURPOSE : get start time modified by dynamic configuration |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 int GetTimerStartValue ( T_HANDLE caller, USHORT index, T_TIME org_value, T_TIME *new_value ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 T_TIMER_CONFIG_ENTRY *t_config_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 int found; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 if ( t_config != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 found = FALSE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 t_config_entry = t_config; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 while ( found == FALSE && t_config_entry != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 if ( t_config_entry->entity == caller |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 && t_config_entry->index == index ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 found = TRUE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 switch (t_config_entry->mode) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 case TIMER_SET: |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 *new_value = t_config_entry->value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 break; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 case TIMER_RESET: |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 *new_value = org_value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 break; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 case TIMER_SPEED_UP: |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 *new_value = org_value / t_config_entry->value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 break; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 case TIMER_SLOW_DOWN: |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 *new_value = org_value * t_config_entry->value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 break; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 default: |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 vsi_o_ttrace ( caller, TC_TIMER, "Timerstart: Index %d, Time %d -> %d",index, org_value, *new_value ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 t_config_entry = t_config_entry->next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 if ( found == FALSE ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 *new_value = org_value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 else |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 *new_value = org_value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 if (*new_value == 0) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 *new_value = 1; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 #ifndef RUN_FLASH |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 | STATE : code ROUTINE : vsi_t_start | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 PURPOSE : start timer that expires only once |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 int vsi_t_start (T_HANDLE Caller, USHORT TimerIndex, T_TIME Value) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 OS_HANDLE TimerHandle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 vsi_o_ttrace ( Caller, TC_TIMER, "Timerstart: Index %d, Time %d",TimerIndex, Value) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 if ( TimerIndex >= pf_TaskTable[Caller].NumOfTimers ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 vsi_o_assert( NO_TASK, OS_SYST_ERR_TASK_TIMER, __FILE__, __LINE__, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 "TimerIndex > NumOfTimers for entity %s", pf_TaskTable[Caller].Name ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 TimerHandle = (*(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) & TIMER_HANDLE_MASK); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 if ( !TimerHandle ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 if ( os_CreateTimer ( Caller, pf_Timeout, &TimerHandle, pf_TaskTable[Caller].MemPoolHandle ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 vsi_o_assert( Caller, OS_SYST_ERR_SIMUL_TIMER, __FILE__, __LINE__, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 "Number of started timers > MAX_SIMULTANEOUS_TIMER" ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 if ( timer_configured && GetTimerStartValue ( Caller, TimerIndex, Value, &Value ) == VSI_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 *(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) = TimerHandle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 if ( os_StartTimer ( Caller, TimerHandle, TimerIndex, Value, 0 ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 | STATE : code ROUTINE : vsi_t_pstart | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 PURPOSE : start periodic timer |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 int vsi_t_pstart (T_HANDLE Caller, USHORT TimerIndex, T_TIME Value1, T_TIME Value2 ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 OS_HANDLE TimerHandle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 vsi_o_ttrace ( Caller, TC_TIMER, "Timerstart: Index %d, ITime %d PTime %d",TimerIndex, Value1, Value2) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 if ( TimerIndex >= pf_TaskTable[Caller].NumOfTimers ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 vsi_o_assert( NO_TASK, OS_SYST_ERR_TASK_TIMER, __FILE__, __LINE__, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 "TimerIndex > NumOfTimers for entity %s", pf_TaskTable[Caller].Name ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 TimerHandle = (*(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) & TIMER_HANDLE_MASK); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 if ( !TimerHandle ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 if ( os_CreateTimer ( Caller, pf_Timeout, &TimerHandle, pf_TaskTable[Caller].MemPoolHandle ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 vsi_o_assert( Caller, OS_SYST_ERR_SIMUL_TIMER, __FILE__, __LINE__, |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 "Number of started timers > MAX_SIMULTANEOUS_TIMER" ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 if ( timer_configured && GetTimerStartValue ( Caller, TimerIndex, Value1, &Value1 ) == VSI_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 if ( timer_configured && GetTimerStartValue ( Caller, TimerIndex, Value2, &Value2 ) == VSI_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 *(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) = TimerHandle | PERIODIC_TIMER; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 if ( os_StartTimer ( Caller, TimerHandle, TimerIndex, Value1, Value2 ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 #ifndef RUN_FLASH |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 | STATE : code ROUTINE : vsi_t_stop | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 PURPOSE : stop timer |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 int vsi_t_stop (T_HANDLE Caller, USHORT TimerIndex ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 OS_HANDLE TimerHandle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 vsi_o_ttrace ( Caller, TC_TIMER, "Timerstop: Index %d",TimerIndex) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 TimerHandle = (*(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) & TIMER_HANDLE_MASK); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 if ( TimerHandle && ( (TimerHandle & TIMER_HANDLE_MASK) < MaxTimer ) ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 if ( os_StopTimer ( Caller, TimerHandle ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 if ( os_DestroyTimer ( Caller, TimerHandle ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 os_StopTimer ( Caller, TimerHandle ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 os_DestroyTimer ( Caller, TimerHandle ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 *(pf_TaskTable[Caller].FirstTimerEntry + TimerIndex) = 0; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 | STATE : code ROUTINE : vsi_t_status | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 PURPOSE : request remaining time |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 int vsi_t_status (T_HANDLE Caller, USHORT Index, T_TIME *Value ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 OS_HANDLE TimerHandle; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 if ( (TimerHandle = (*(pf_TaskTable[Caller].FirstTimerEntry + Index) & TIMER_HANDLE_MASK) ) < MaxTimer ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 if ( TimerHandle == 0 || (*(pf_TaskTable[Caller].FirstTimerEntry + Index) & TIMEOUT_OCCURRED) ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 *Value = 0; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 vsi_o_ttrace ( Caller, TC_TIMER, "Timerstatus: Index %d, Remaining_time %d",Index, *Value) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 In case the timer interrupt occurrs just after the check 5 lines above, this will be handled by |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 os_QueryTimer() returning a Value of 0 because thew expired timer can no longer be found in the list. |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 if ( os_QueryTimer ( Caller, TimerHandle, Value ) == OS_ERROR ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 *Value = 0; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 vsi_o_ttrace ( Caller, TC_TIMER, "Timerstatus: Index %d, Remaining time %d",Index, *Value) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 vsi_o_ttrace ( Caller, TC_TIMER, "TimerHandle out of range: Index %d, TimerHandle %d",Index, TimerHandle ) ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 | STATE : code ROUTINE : vsi_t_config | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 +--------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 PURPOSE : timer configuration |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 int vsi_t_config (T_HANDLE caller, USHORT index, UBYTE mode, ULONG value ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 T_TIMER_CONFIG_ENTRY *t_config_entry = NULL; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 T_TIMER_CONFIG_ENTRY *t_next_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 T_TIMER_CONFIG_ENTRY *t_new_entry = NULL; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 int found = FALSE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 if ( index < pf_TaskTable[caller].NumOfTimers ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 if ( t_config != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 t_next_entry = t_config; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 do |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 t_config_entry = t_next_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 if ( t_config_entry->entity == caller |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 && t_config_entry->index == index ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 found = TRUE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 break; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
354 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 t_next_entry = t_config_entry->next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 } while ( t_next_entry != NULL ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 if ( found == FALSE ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
361 if ( os_AllocateMemory ( caller, (T_VOID_STRUCT**)&t_new_entry, sizeof(T_TIMER_CONFIG_ENTRY), OS_NO_SUSPEND, ext_data_pool_handle ) == OS_TIMEOUT ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
362 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
363 t_new_entry->next = NULL; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
364 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
365 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
366 if ( t_config == NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
367 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
368 t_config = t_new_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
369 t_config_entry = t_new_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
370 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
371 else |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
372 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
373 if ( found == FALSE && t_config_entry != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
374 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
375 t_config_entry->next = t_new_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
376 t_config_entry = t_new_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
377 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
378 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
379 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
380 if ( t_config_entry != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
381 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
382 t_config_entry->entity = caller; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
383 t_config_entry->index = index; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
384 t_config_entry->mode = mode; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
385 t_config_entry->value = value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
386 timer_configured = TRUE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
387 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
388 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
389 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
390 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
391 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
392 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
393 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
394 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
395 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
396 +------------------------------------------------------------------------------ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
397 | Function : _vsi_t_config |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
398 +------------------------------------------------------------------------------ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
399 | Description : Parse a timer configuration string into the components |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
400 | timer index, timer mode, timer value. |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
401 | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
402 | Parameters : Caller - calling task |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
403 | *CfgString - configuration string |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
404 | *pTable - pointer to configuration string table |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
405 | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
406 | Return : VSI_OK |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
407 | VSI_ERROR |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
408 +------------------------------------------------------------------------------ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
409 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
410 int _vsi_t_config ( T_HANDLE Caller, char *CfgString, const T_STR_IND *pTable ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
411 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
412 T_TIMER_CONFIG_ENTRY *t_config_entry; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
413 T_TIMER_CONFIG_ENTRY *t_next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
414 char token[20]; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
415 unsigned int offset = 0,len; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
416 USHORT Index; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
417 BYTE Mode; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
418 int i = 0; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
419 unsigned int Value; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
420 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
421 if ( pTable != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
422 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
423 len = GetNextToken (CfgString, token, " #"); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
424 offset = offset + len +1; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
425 while ( StrInd[i].Str && strcmp ( token, StrInd[i].Str ) ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
426 { i++; } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
427 if ( StrInd[i].Str == NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
428 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
429 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
430 if ( (Mode = (BYTE)StrInd[i].Ind) == TIMER_CLEAN ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
431 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
432 t_config_entry = t_config; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
433 while ( t_config_entry != NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
434 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
435 t_next = t_config_entry->next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
436 os_DeallocateMemory ( Caller, (T_VOID_STRUCT*)t_config_entry ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
437 t_config_entry = t_next; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
438 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
439 t_config = NULL; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
440 return VSI_OK; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
441 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
442 len = GetNextToken (CfgString+offset, token, " #"); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
443 offset = offset + len +1; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
444 while ( pTable->Str && strcmp ( token, pTable->Str ) ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
445 { pTable++; } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
446 if ( pTable->Str == NULL ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
447 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
448 vsi_o_ttrace ( 0, TC_SYSTEM, "Timer not found!") ; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
449 return VSI_OK; /* VSI_OK is returned to avoid creating a new return code */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
450 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
451 Index = pTable->Ind; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
452 len = GetNextToken (CfgString+offset, token, " #"); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
453 Value = ASCIIToHex (token, CHARS_FOR_32BIT); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
454 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
455 return ( vsi_t_config ( Caller, Index, Mode, Value ) ); |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
456 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
457 return VSI_ERROR; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
458 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
459 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
460 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
461 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
462 #ifndef RUN_INT_RAM |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
463 /* |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
464 +---------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
465 | PROJECT : GSM-Frame (8415) MODULE : VSI_TIM | |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
466 | STATE : code ROUTINE : InitializeTimerConfig| |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
467 +---------------------------------------------------------------------+ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
468 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
469 PURPOSE : initialize timer configuration |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
470 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
471 */ |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
472 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
473 void InitializeTimer ( void ) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
474 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
475 int i; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
476 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
477 for ( i = 0; i <= MaxTimer; i++) |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
478 { |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
479 TimerHandleField[i] = 0; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
480 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
481 timer_configured = FALSE; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
482 t_config = NULL; |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
483 } |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
484 #endif |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
485 |
79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
486 |