Changeset 1285 for trunk/csctapi/pps.c
- Timestamp:
- 01/19/10 12:03:40 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/pps.c
r1283 r1285 38 38 39 39 #define PPS_DEFAULT_PROTOCOL 0x00 40 40 #define PROTOCOL_T0_DEFAULT_WI 10 41 41 /* 42 42 * Not exported macros definition … … 490 490 int ret; 491 491 492 if (parameters.t == ATR_PROTOCOL_TYPE_T0) 493 { 494 ret = Protocol_T0_Init (&(parameters)); 495 496 if (ret != PROTOCOL_T0_OK) 497 { 498 protocol = NULL; 499 return PPS_PROTOCOL_ERROR; 500 } 501 502 return PPS_OK; 492 if ((parameters.t == ATR_PROTOCOL_TYPE_T0) || (parameters.t == ATR_PROTOCOL_TYPE_T14)) 493 { 494 BYTE wi; 495 496 /* Integer value WI = TC2, by default 10 */ 497 #ifndef PROTOCOL_T0_USE_DEFAULT_TIMINGS 498 if (ATR_GetInterfaceByte (atr, 2, ATR_INTERFACE_BYTE_TC, &(wi)) != ATR_OK) 499 #endif 500 wi = PROTOCOL_T0_DEFAULT_WI; 501 502 /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */ 503 double F = (double) atr_f_table[parameters.FI]; 504 unsigned long wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ()) * 1000); 505 if (parameters.t == 14) 506 wwt >>= 1; //is this correct? 507 508 /* Set timings */ 509 icc_timings.block_timeout = wwt; 510 icc_timings.char_timeout = wwt; 511 ICC_Async_SetTimings (); 512 513 #ifdef DEBUG_PROTOCOL 514 printf ("Protocol: T=%i: WWT=%d, Clockrate=%lu\n", params->t, (int)(wwt),ICC_Async_GetClockRate()); 515 #endif 516 return PPS_OK; 503 517 } 504 518 else if (parameters.t == ATR_PROTOCOL_TYPE_T1) … … 514 528 return PPS_OK; 515 529 } 516 else if (parameters.t == ATR_PROTOCOL_TYPE_T14)517 {518 ret = Protocol_T14_Init (&(parameters));519 520 if (ret != PROTOCOL_T14_OK)521 {522 protocol = NULL;523 return PPS_PROTOCOL_ERROR;524 }525 526 return PPS_OK;527 }528 530 else 529 531 {
Note:
See TracChangeset
for help on using the changeset viewer.