libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v0.16-14-gef6f483

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 3 Nov 2009 17:40:03 +0100 (CET)
The branch, master has been updated
       via  ef6f483889aa3d719a676f7f32303c4232941e57 (commit)
      from  8af5bbc7a631bd63e9f3c3d0f702c1cfe6a27196 (commit)


- Log -----------------------------------------------------------------
commit ef6f483889aa3d719a676f7f32303c4232941e57
Author: Thimo Eichstaedt <abc@xxxxxxxxxx>
Date:   Tue Nov 3 17:39:21 2009 +0100

    Set initial baudrate on correct interface instead of always the first one 
(Thimo Eichstaedt)
    
    From libftdi mailinglist mail:
    1) in ftdi_usb_open_dev() the baudrate is set to 9600, but that is done
    too early (before the interface is set). So the baudrate of the first
    interface is always modified, even if you opened a different one.

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

Summary of changes:
 src/ftdi.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 9f12c41..d2c4a11 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -454,12 +454,6 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct 
usb_device *dev)
         ftdi_error_return(-6, "ftdi_usb_reset failed");
     }
 
-    if (ftdi_set_baudrate (ftdi, 9600) != 0)
-    {
-        ftdi_usb_close_internal (ftdi);
-        ftdi_error_return(-7, "set baudrate failed");
-    }
-
     // Try to guess chip type
     // Bug in the BM type chips: bcdDevice is 0x200 for serial == 0
     if (dev->descriptor.bcdDevice == 0x400 || (dev->descriptor.bcdDevice == 
0x200
@@ -489,6 +483,12 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct 
usb_device *dev)
             break;
     }
 
+    if (ftdi_set_baudrate (ftdi, 9600) != 0)
+    {
+        ftdi_usb_close_internal (ftdi);
+        ftdi_error_return(-7, "set baudrate failed");
+    }
+
     ftdi_error_return(0, "all fine");
 }
 


hooks/post-receive
-- 
A library to talk to FTDI chips

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

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v0.16-14-gef6f483, libftdi-git <=