comparison gsm-fw/gpf/tst_drv/ser_tr.c @ 325:ffb0442ffccf

gsm-fw/gpf/tst_drv: got as far as compiling tr2.c
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 19 Apr 2014 00:18:44 +0000
parents 5d1e22505446
children
comparison
equal deleted inserted replaced
324:7228920a0834 325:ffb0442ffccf
19 19
20 #ifndef __SER_TR_C__ 20 #ifndef __SER_TR_C__
21 #define __SER_TR_C__ 21 #define __SER_TR_C__
22 #endif 22 #endif
23 23
24 #include "gpfconf.h"
24 #include "typedefs.h" 25 #include "typedefs.h"
25 #include "traceswitch.h" 26 #include "../../serial/traceswitch.h"
26 #include "serialswitch.h" 27 #include "../../serial/serialswitch.h"
27 #include "gdi.h" 28 #include "gdi.h"
28 #include "tstheader.h" 29 #include "tstheader.h"
29 30
30 /*==== TYPES ======================================================*/ 31 /*==== TYPES ======================================================*/
31 32
66 PURPOSE : callback function of the driver 67 PURPOSE : callback function of the driver
67 68
68 */ 69 */
69 void Callback ( void ) 70 void Callback ( void )
70 { 71 {
71 if ( SER_TR_Data.EnabledSignalType & DRV_SIGTYPE_READ ) 72 if ( SER_TR_Data.EnabledSignalType & DRV_SIGTYPE_READ )
72 { 73 {
73 Signal.SignalType = DRV_SIGTYPE_READ; 74 Signal.SignalType = DRV_SIGTYPE_READ;
74 Signal.DrvHandle = SER_TR_Data.Handle; 75 Signal.DrvHandle = SER_TR_Data.Handle;
75 76
76 (SER_TR_Data.Callback)( &Signal ); 77 (SER_TR_Data.Callback)( &Signal );
77 } 78 }
78 } 79 }
79 #endif 80 #endif
147 PURPOSE : enable signal for the driver 148 PURPOSE : enable signal for the driver
148 149
149 */ 150 */
150 USHORT SER_TR_SetSignal ( USHORT SignalType ) 151 USHORT SER_TR_SetSignal ( USHORT SignalType )
151 { 152 {
152 if ( !(SignalType & ALLOWED_SER_TR_SIGNALS) ) 153 if ( !(SignalType & ALLOWED_SER_TR_SIGNALS) )
153 return DRV_INVALID_PARAMS; 154 return DRV_INVALID_PARAMS;
154 else 155 else
155 SER_TR_Data.EnabledSignalType |= SignalType; 156 SER_TR_Data.EnabledSignalType |= SignalType;
156 157
157 return DRV_OK; 158 return DRV_OK;
168 PURPOSE : disable signal for the driver 169 PURPOSE : disable signal for the driver
169 170
170 */ 171 */
171 USHORT SER_TR_ResetSignal ( USHORT SignalType ) 172 USHORT SER_TR_ResetSignal ( USHORT SignalType )
172 { 173 {
173 if ( !(SignalType & ALLOWED_SER_TR_SIGNALS) ) 174 if ( !(SignalType & ALLOWED_SER_TR_SIGNALS) )
174 return DRV_INVALID_PARAMS; 175 return DRV_INVALID_PARAMS;
175 else 176 else
176 SER_TR_Data.EnabledSignalType &= ~SignalType; 177 SER_TR_Data.EnabledSignalType &= ~SignalType;
177 178
178 return DRV_OK; 179 return DRV_OK;
193 { 194 {
194 195
195 if ( !SER_TR_Data.Connected ) 196 if ( !SER_TR_Data.Connected )
196 { 197 {
197 Signal.SignalType = DRV_SIGTYPE_CONNECT; 198 Signal.SignalType = DRV_SIGTYPE_CONNECT;
198 Signal.DrvHandle = SER_TR_Data.Handle; 199 Signal.DrvHandle = SER_TR_Data.Handle;
199 Signal.UserData = NULL; 200 Signal.UserData = NULL;
200 (SER_TR_Data.Callback)( &Signal ); 201 (SER_TR_Data.Callback)( &Signal );
201 SER_TR_Data.Connected = TRUE; 202 SER_TR_Data.Connected = TRUE;
202 return DRV_OK; 203 return DRV_OK;
203 } 204 }