From 118fec1db9c092bc38021774428f6cf5ed959d48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu>
Date: Sat, 28 Jul 2012 08:40:21 +0000
Subject: [PATCH] olved a bug in the FTDI module. The flow control was set to
 RTS/CTS and must be NONE.

---
 src/usb_ftdi/ftdimodule.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/usb_ftdi/ftdimodule.cpp b/src/usb_ftdi/ftdimodule.cpp
index 33bd12f..4137d05 100644
--- a/src/usb_ftdi/ftdimodule.cpp
+++ b/src/usb_ftdi/ftdimodule.cpp
@@ -104,7 +104,12 @@ void CFTDI::hard_config(void *config)
       /* handle exceptions */
       throw CFTDIException(_HERE_,error_messages[ft_status],this->comm_id);
     }
-    usleep(100);
+    usleep(1000000);
+    if((ft_status=FT_SetBitMode(this->ft_handle,0xFF,0x40))!=FT_OK)
+    {
+      /* handle exceptions */
+      throw CFTDIException(_HERE_,error_messages[ft_status],this->comm_id);
+    }
 
     if((ft_status=FT_SetLatencyTimer(this->ft_handle,2))!=FT_OK)
     {
@@ -123,7 +128,7 @@ void CFTDI::hard_config(void *config)
       /* handle exceptions */
       throw CFTDIException(_HERE_,error_messages[ft_status],this->comm_id);
     }
-    if((ft_status=FT_Purge(this->ft_handle,FT_PURGE_RX))!=FT_OK)
+    if((ft_status=FT_Purge(this->ft_handle,FT_PURGE_TX|FT_PURGE_RX))!=FT_OK)
     {
       /* handle exceptions */
       throw CFTDIException(_HERE_,error_messages[ft_status],this->comm_id);
-- 
GitLab