annotate gsm-fw/g23m-gsm/alr/alr_tim.c @ 673:2f7df7a314f8

gsm-fw/g23m-gsm subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 28 Sep 2014 23:20:04 +0000
parents
children 4094f0d750c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
673
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | Project :
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 | Modul : J:\g23m-gsm\alr\alr_tim.c
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 | All rights reserved.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | Instruments Berlin, AG
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | Purpose :
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 #ifndef ALR_TIM_C
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #define ALR_TIM_C
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #define ENTITY_PL
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 /*==== INCLUDES ===================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 #include <string.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 #include <stdlib.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 #include <ctype.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "typedefs.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "pconst.cdg"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 #include "mconst.cdg"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "message.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "ccdapi.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #include "vsi.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "custom.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #include "gsm.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "prim.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 #include "cnf_alr.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 #include "mon_alr.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 #include "pei.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "tok.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "pcm.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 #ifdef GPRS
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 #include "alr_gprs.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 #endif
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 #include "alr.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 /*==== PRIVAT =====================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 #if defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 #define TRACE_TIMER(FMT) TRACE_EVENT((FMT))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 #define TRACE_TIMER_P1(FMT,P1) TRACE_EVENT_P1((FMT),(P1))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 #define TRACE_TIMER_P2(FMT,P1,P2) TRACE_EVENT_P2((FMT),(P1),(P2))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 #define TRACE_TIMER_P3(FMT,P1,P2,P3) TRACE_EVENT_P3((FMT),(P1),(P2),(P3))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 #else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 #define TRACE_TIMER(FMT)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 #define TRACE_TIMER_P1(FMT,P1)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 #define TRACE_TIMER_P2(FMT,P1,P2)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 #define TRACE_TIMER_P3(FMT,P1,P2,P2)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 #endif
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 /* Implements Measure#32: Row 247, 248, 249, 251, 252, 259 and 260 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 static T_S2I_STRING const tim_names[] =
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 S2I_STRING("TIM_POWERMEAS"),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 S2I_STRING("TIM_NW_SYNC_GUARD"),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 #if defined(FF_HOMEZONE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 S2I_STRING("TIM_HOMEZONE"),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 #endif /* FF_HOMEZONE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 S2I_STRING("???")
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 };
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 /*==== EXPORT =====================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 /*==== FUCTIONS ===================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 #if defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 void trace_timer (USHORT index, long value)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 switch(value)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 /* Implements Measure#32: Row 247, 248, 249, 251 and 252 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 default:/* >0: start */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 TRACE_TIMER_P2 ("T-Start:%s=%lu", S2I_STRING(tim_names[index]), value);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 case 0:/* ==0: stop */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 TRACE_TIMER_P1 ("T-Stop:%s", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 case -1:/* -1: expire */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 TRACE_TIMER_P1 ("T-Expired:%s ", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 case -2:/* -2: check */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 if(alr_data->tim_data.running[index])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 TRACE_TIMER_P1 ("T-Check:%s active", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 TRACE_TIMER_P1 ("T-Check:%s inactive", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 case -3:/* -2: set expire function */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 TRACE_TIMER_P1 ("T-Set:%s expire function", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 #else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 #define trace_timer(index,value)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 #endif /* TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 | PROJECT : GSM-PS (6147) MODULE : RR_TIM |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 | STATE : code ROUTINE : tim_exec_timeout |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 PURPOSE : reset timeout functions and values.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 GLOBAL void tim_init (void)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 TRACE_FUNCTION ("tim_init()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 memset (&alr_data->tim_data, 0, sizeof (alr_data->tim_data));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 alr_data->tim_data.expire[TIM_POWERMEAS] = ma_cs_rxlev_req;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 alr_data->tim_data.expire[TIM_NW_SYNC_GUARD] = tim_stop_sync_to_nw;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 #if defined(FF_HOMEZONE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 alr_data->tim_data.expire[TIM_HOMEZONE] = cb_tim_homezone;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 #endif /* FF_HOMEZONE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 | PROJECT : GSM-PS (6147) MODULE : RR_TIM |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 | STATE : code ROUTINE : tim_exec_timeout |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 PURPOSE : execute timeout for the new frame variant.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 GLOBAL void tim_exec_timeout (USHORT index)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 #if !defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 TRACE_FUNCTION ("tim_exec_timeout()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 #endif /* !TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 if (index < NUM_OF_ALR_TIMERS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 trace_timer (index, -1);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 alr_data->tim_data.running[index] = 0;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 if (alr_data->tim_data.expire[index])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 alr_data->tim_data.expire[index] ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 SYST_TRACE_P ((SYST, "tim_exec_timeout: index=%u (>=%u)", index, NUM_OF_ALR_TIMERS));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 TRACE_ASSERT (index < NUM_OF_ALR_TIMERS);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 | PROJECT : GSM-PS (6147) MODULE : RR_TIM |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 | STATE : code ROUTINE : tim_stop_timer |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 PURPOSE : stop timer in the new frame variant.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 GLOBAL void tim_stop_timer (USHORT index)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 #if !defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 TRACE_FUNCTION ("tim_stop_timer()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 #endif /* !TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 if (index < NUM_OF_ALR_TIMERS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 trace_timer (index, 0);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 alr_data->tim_data.running[index] = 0;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 * stop physical timer.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 TIMER_STOP(pl_handle, index);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 SYST_TRACE_P ((SYST,"tim_stop_timer: index=%u (>=%u)", index, NUM_OF_ALR_TIMERS));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 TRACE_ASSERT (index < NUM_OF_ALR_TIMERS);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 | PROJECT : GSM-PS (6147) MODULE : RR_TIM |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 | STATE : code ROUTINE : tim_start_timer |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 PURPOSE : start timer in the new frame variant.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 GLOBAL void tim_start_timer (USHORT index, T_TIME value)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 #if !defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 TRACE_FUNCTION ("tim_start_timer()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 #endif /* !TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 if (index < NUM_OF_ALR_TIMERS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221 trace_timer (index, value);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 alr_data->tim_data.running[index] = 1;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 * start physical timer.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 TIMER_START(pl_handle, index, value);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 SYST_TRACE_P ((SYST,"tim_start_timer: index=%u (>=%u)", index, NUM_OF_ALR_TIMERS));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 TRACE_ASSERT (index < NUM_OF_ALR_TIMERS);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238 | PROJECT : GSM-PS (6147) MODULE : RR_TIM |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 | STATE : code ROUTINE : tim_check_timer |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 PURPOSE : check timer in the new frame variant.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 GLOBAL BOOL tim_check_timer(USHORT index)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 T_TIME value = 0;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 #if !defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 TRACE_FUNCTION ("tim_check_timer()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 #endif /* !TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254 if (index < NUM_OF_ALR_TIMERS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 #if defined(TIMER_TRACE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 if (alr_data->tim_data.running[index])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 SHORT vsi_ret;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 vsi_ret = TIMER_STATUS(pl_handle, index, &value);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 if ((vsi_ret EQ VSI_OK) AND (value NEQ 0))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 /* Implements Measure#32: Row 259 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 TRACE_TIMER_P2 ("T-Check:%s active (%u left)", S2I_STRING(tim_names[index]), value);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 /* Implements Measure#32: Row 260 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 TRACE_TIMER_P1 ("T-Check:%s inactive", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 /* Implements Measure#32: Row 260 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 TRACE_TIMER_P1 ("T-Check:%s inactive", S2I_STRING(tim_names[index]));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 #endif /* TIMER_TRACE */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279 return alr_data->tim_data.running[index];
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 SYST_TRACE_P ((SYST,"tim_check_timer: index=%u (>=%u)", index, NUM_OF_ALR_TIMERS));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 TRACE_ASSERT (index < NUM_OF_ALR_TIMERS);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285 return FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 #endif /* ALR_TIM_C */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290