+ }
+ }
+
+ ftdi_usb_purge_buffers(&ftdic);
+ ftdi_write_data(&ftdic, writebuf, pos-writebuf);
+
+ i = 0;
+ do {
+#if 0
+ ftdi_write_data(&ftdic, &last_data, 1);
+#endif
+ i += ftdi_read_data(&ftdic, readbuf, sizeof(readbuf));
+ } while (i < pos-writebuf);
+
+#ifdef DEBUG
+ DPRINTF("write: ");
+ hexdump(writebuf, pos-writebuf);
+ DPRINTF("read: ");
+ hexdump(readbuf, i);
+#endif
+
+ pos = readbuf;
+
+ for (i = 0; i < num; i++) {
+ DPRINTF("dwPort: 0x%lx, cmdTrans: %lu, dwbytes: %ld, fautoinc: %ld, dwoptions: %ld\n",
+ (unsigned long)tr[i].dwPort, tr[i].cmdTrans, tr[i].dwBytes,
+ tr[i].fAutoinc, tr[i].dwOptions);
+
+ port = (unsigned long)tr[i].dwPort;
+ val = tr[i].Data.Byte;
+ pos++;
+
+ if (port == ppbase + PP_STATUS) {