FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/tst_drv/titrc.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 |
---|---|
21 | 21 |
22 #ifndef __TITRC_C__ | 22 #ifndef __TITRC_C__ |
23 #define __TITRC_C__ | 23 #define __TITRC_C__ |
24 #endif | 24 #endif |
25 | 25 |
26 #include <string.h> | |
27 #include "gpfconf.h" | |
26 #include "typedefs.h" | 28 #include "typedefs.h" |
27 #include "string.h" | |
28 #include "tstheader.h" | 29 #include "tstheader.h" |
29 #include "rvt_gen.h" | 30 #include "../../riviera/rvt/rvt_gen.h" |
30 #include "gdi.h" | 31 #include "gdi.h" |
31 #include "serialswitch.h" | 32 #include "../../serial/serialswitch.h" |
32 | 33 |
33 /*==== TYPES ======================================================*/ | 34 /*==== TYPES ======================================================*/ |
34 | 35 |
35 typedef struct | 36 typedef struct |
36 { | 37 { |
183 PURPOSE : enable signal for the driver | 184 PURPOSE : enable signal for the driver |
184 | 185 |
185 */ | 186 */ |
186 USHORT TITRC_SetSignal ( USHORT SignalType ) | 187 USHORT TITRC_SetSignal ( USHORT SignalType ) |
187 { | 188 { |
188 if ( !(SignalType & ALLOWED_TITRC_SIGNALS) ) | 189 if ( !(SignalType & ALLOWED_TITRC_SIGNALS) ) |
189 return DRV_INVALID_PARAMS; | 190 return DRV_INVALID_PARAMS; |
190 else | 191 else |
191 TITRC_Data.EnabledSignalType |= SignalType; | 192 TITRC_Data.EnabledSignalType |= SignalType; |
192 | 193 |
193 return DRV_OK; | 194 return DRV_OK; |
204 PURPOSE : disable signal for the driver | 205 PURPOSE : disable signal for the driver |
205 | 206 |
206 */ | 207 */ |
207 USHORT TITRC_ResetSignal ( USHORT SignalType ) | 208 USHORT TITRC_ResetSignal ( USHORT SignalType ) |
208 { | 209 { |
209 if ( !(SignalType & ALLOWED_TITRC_SIGNALS) ) | 210 if ( !(SignalType & ALLOWED_TITRC_SIGNALS) ) |
210 return DRV_INVALID_PARAMS; | 211 return DRV_INVALID_PARAMS; |
211 else | 212 else |
212 TITRC_Data.EnabledSignalType &= ~SignalType; | 213 TITRC_Data.EnabledSignalType &= ~SignalType; |
213 | 214 |
214 return DRV_OK; | 215 return DRV_OK; |
229 { | 230 { |
230 | 231 |
231 if ( TITRC_Data.connected == FALSE ) | 232 if ( TITRC_Data.connected == FALSE ) |
232 { | 233 { |
233 Signal.SignalType = DRV_SIGTYPE_CONNECT; | 234 Signal.SignalType = DRV_SIGTYPE_CONNECT; |
234 Signal.DrvHandle = TITRC_Data.Handle; | 235 Signal.DrvHandle = TITRC_Data.Handle; |
235 (TITRC_Data.Callback)( &Signal ); | 236 (TITRC_Data.Callback)( &Signal ); |
236 TITRC_Data.connected = TRUE; | 237 TITRC_Data.connected = TRUE; |
237 } | 238 } |
238 return DRV_OK; | 239 return DRV_OK; |
239 } | 240 } |
254 { | 255 { |
255 if ( callback_busy == 1 ) | 256 if ( callback_busy == 1 ) |
256 for (;;) | 257 for (;;) |
257 ; | 258 ; |
258 | 259 |
259 callback_busy = 1; | 260 callback_busy = 1; |
260 if ( TITRC_Data.EnabledSignalType & DRV_SIGTYPE_READ ) | 261 if ( TITRC_Data.EnabledSignalType & DRV_SIGTYPE_READ ) |
261 { | 262 { |
262 TITRC_Data.read_ptr = ptr; | 263 TITRC_Data.read_ptr = ptr; |
263 TITRC_Data.read_len = len; | 264 TITRC_Data.read_len = len; |
264 Signal.SignalType = DRV_SIGTYPE_READ; | 265 Signal.SignalType = DRV_SIGTYPE_READ; |
265 Signal.DrvHandle = TITRC_Data.Handle; | 266 Signal.DrvHandle = TITRC_Data.Handle; |
266 (TITRC_Data.Callback)( &Signal ); | 267 (TITRC_Data.Callback)( &Signal ); |
267 } | 268 } |
268 callback_busy = 0; | 269 callback_busy = 0; |
269 } | 270 } |
270 #endif | 271 #endif |
271 | 272 |
272 #ifndef RUN_INT_RAM | 273 #ifndef RUN_INT_RAM |
273 /* | 274 /* |