Changeset 337 for branches/merlin/csctapi
- Timestamp:
- 08/27/09 02:44:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/merlin/csctapi/io_serial.c
r335 r337 71 71 static void IO_Serial_ClearPropertiesCache(IO_Serial * io); 72 72 73 static int _in_echo_read = 0;74 int io_serial_need_dummy_char = 0;75 76 73 extern int reader_serial_mhz; 77 74 extern int reader_serial_irdeto_mode; 75 76 static int _in_echo_read = 0; 77 extern int reader_serial_need_dummy_char; 78 78 79 79 int fdmc = (-1); … … 695 695 fflush(stdout); 696 696 #endif 697 for (count = 0; count < size * (_in_echo_read ? (1 + io_serial_need_dummy_char) : 1); count++) {697 for (count = 0; count < size * (_in_echo_read ? (1 + reader_serial_need_dummy_char) : 1); count++) { 698 698 if (IO_Serial_WaitToRead(io->fd, 0, timeout)) { 699 699 if (read(io->fd, &c, 1) != 1) { … … 704 704 return FALSE; 705 705 } 706 data[_in_echo_read ? count / (1 + io_serial_need_dummy_char) : count] = c;706 data[_in_echo_read ? count / (1 + reader_serial_need_dummy_char) : count] = c; 707 707 708 708 #ifdef DEBUG_IO … … 756 756 if (IO_Serial_WaitToWrite(io, delay, 1000)) { 757 757 for (i_w = 0; i_w < to_send; i_w++) { 758 data_w[(1 + io_serial_need_dummy_char) * i_w] = data[count + i_w];759 if ( io_serial_need_dummy_char) {758 data_w[(1 + reader_serial_need_dummy_char) * i_w] = data[count + i_w]; 759 if (reader_serial_need_dummy_char) { 760 760 data_w[2 * i_w + 1] = 0x00; 761 761 } 762 762 } 763 unsigned int u = write(io->fd, data_w, (1 + io_serial_need_dummy_char) * to_send);763 unsigned int u = write(io->fd, data_w, (1 + reader_serial_need_dummy_char) * to_send); 764 764 765 765 _in_echo_read = 1; 766 if (u != (1 + io_serial_need_dummy_char) * to_send) {766 if (u != (1 + reader_serial_need_dummy_char) * to_send) { 767 767 #ifdef DEBUG_IO 768 768 printf("ERROR\n"); … … 778 778 779 779 #ifdef DEBUG_IO 780 for (i = 0; i < (1 + io_serial_need_dummy_char) * to_send; i++)780 for (i = 0; i < (1 + reader_serial_need_dummy_char) * to_send; i++) 781 781 printf("%X ", data_w[count + i]); 782 782 fflush(stdout);
Note:
See TracChangeset
for help on using the changeset viewer.