EEPROM: Fix typos around high_cuttent_drive and make code comipile again. Will care...
[libftdi] / src / ftdi_stream.c
index 076ebd4..d39fc2a 100644 (file)
@@ -198,7 +198,7 @@ ftdi_readstream(struct ftdi_context *ftdi,
      */
     if (ftdi_set_bitmode(ftdi,  0xff, BITMODE_SYNCFF) < 0)
     {
-        fprintf(stderr,"Can't set synchronous fifo mode\n",
+        fprintf(stderr,"Can't set synchronous fifo mode: %s\n",
                 ftdi_get_error_string(ftdi));
         goto cleanup;
     }
@@ -216,10 +216,10 @@ ftdi_readstream(struct ftdi_context *ftdi,
         struct timeval timeout = { 0, ftdi->usb_read_timeout };
         struct timeval now;
         
-        int err = libusb_handle_events_timeout(NULL, &timeout);
+        int err = libusb_handle_events_timeout(ftdi->usb_ctx, &timeout);
         if (err ==  LIBUSB_ERROR_INTERRUPTED)
             /* restart interrupted events */
-            err = libusb_handle_events_timeout(NULL, &timeout);  
+            err = libusb_handle_events_timeout(ftdi->usb_ctx, &timeout);  
         if (!state.result)
         {
             state.result = err;