libftdi-git Archives

Subject: port libftdi to libusb-1.0 branch, master, updated. v0.17-229-g95f29fc

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 27 Jul 2011 18:11:03 +0200 (CEST)
The branch, master has been updated
       via  95f29fc4118acd6df2667d39b12597b561aa0d0c (commit)
      from  bb104e5b1066701452e56fb0fbacd1851f2ab22a (commit)


- Log -----------------------------------------------------------------
commit 95f29fc4118acd6df2667d39b12597b561aa0d0c
Author: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date:   Wed Jul 20 11:12:39 2011 +0200

    Only try ftdi_usb_open_dev if devices found

-----------------------------------------------------------------------

Summary of changes:
 examples/eeprom.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/examples/eeprom.c b/examples/eeprom.c
index e947c00..ef789a3 100644
--- a/examples/eeprom.c
+++ b/examples/eeprom.c
@@ -169,7 +169,20 @@ int main(int argc, char **argv)
             retval = EXIT_SUCCESS;
             goto do_deinit;
         }
-        f = ftdi_usb_open_dev(ftdi,  devlist[0].dev);
+        else if (res == 1)
+        {
+            f = ftdi_usb_open_dev(ftdi,  devlist[0].dev);
+            if (f<0)
+            {
+                fprintf(stderr, "Unable to open device %d: (%s)",
+                        i, ftdi_get_error_string(ftdi));
+            }
+        }
+        else
+        {
+            fprintf(stderr, "No devices found\n");
+            f = 0;
+        }
         ftdi_list_free(&devlist);
     }
     else


hooks/post-receive
-- 
port libftdi to libusb-1.0

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • port libftdi to libusb-1.0 branch, master, updated. v0.17-229-g95f29fc, libftdi-git <=