Ignore:
Timestamp:
01/16/10 17:29:40 (11 years ago)
Author:
dingo35
Message:

Move Reset to ifd_phoenix.c and cleanup lot of overhead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r1252 r1253  
    6565int ICC_Async_Device_Init ()
    6666{
    67    
     67
     68    wr = 0;
    6869#ifdef DEBUG_IO
    6970    printf ("IO: Opening serial port %s\n", reader[ridx].device);
     
    9596        }
    9697#endif
    97        
     98
     99    if (reader[ridx].typ != R_INTERNAL) { //FIXME move to ifd_phoenix.c
     100        if(!IO_Serial_InitPnP ())
     101            return ICC_ASYNC_IFD_ERROR;
     102        IO_Serial_Flush();
     103    }
     104
    98105    return ICC_ASYNC_OK;
    99106}
     
    238245    else
    239246#endif
    240     if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK)
     247    if (!Phoenix_Reset(&(icc->atr)))
    241248    {
    242249        icc->atr = NULL;
     
    277284        if (!IO_Serial_SetParity (PARITY_ODD))
    278285            return ICC_ASYNC_IFD_ERROR;
    279         icc->ifd->io->parity = PARITY_ODD;
    280286    }
    281287    else if(icc->protocol_type == ATR_PROTOCOL_TYPE_T14)
     
    283289        if (!IO_Serial_SetParity (PARITY_NONE))
    284290            return ICC_ASYNC_IFD_ERROR;     
    285         icc->ifd->io->parity = PARITY_NONE;
    286291    }
    287292    else
     
    289294        if (!IO_Serial_SetParity (PARITY_EVEN))
    290295            return ICC_ASYNC_IFD_ERROR;     
    291         icc->ifd->io->parity = PARITY_EVEN;
    292296    }
    293297#ifdef COOL
    294298    if (reader[ridx].typ != R_INTERNAL)
    295299#endif
    296     IO_Serial_Flush(ifd->io);
     300    IO_Serial_Flush();
    297301    return ICC_ASYNC_OK;
    298302#else
Note: See TracChangeset for help on using the changeset viewer.