The branch, master has been updated
       via  4cc6f0cd14660731280ed75a377abe38749acc4f (commit)
      from  7abf523a2ca3912895d087a9b998da6bc7b84339 (commit)


- Log -----------------------------------------------------------------
commit 4cc6f0cd14660731280ed75a377abe38749acc4f
Author: Thomas Jarosch <[email protected]>
Date:   Fri May 6 15:16:03 2011 +0200

    Correct ftdi_poll_modem_status() result code

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

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

diff --git a/AUTHORS b/AUTHORS
index a0b2231..d9fa7c6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -40,5 +40,6 @@ see Changelog for full details:
   Thimo Eichstaedt <[email protected]>
   Thomas Fischl <[email protected]>
   Tim Ansell <[email protected]>
+  Tom Saunders <[email protected]>
   Uwe Bonnes <[email protected]>
   Wilfried Holzke <[email protected]>
diff --git a/src/ftdi.c b/src/ftdi.c
index 54e33c0..e7e91f9 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -1901,7 +1901,7 @@ int ftdi_poll_modem_status(struct ftdi_context *ftdi, 
unsigned short *status)
     if (usb_control_msg(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, 
SIO_POLL_MODEM_STATUS_REQUEST, 0, ftdi->index, usb_val, 2, 
ftdi->usb_read_timeout) != 2)
         ftdi_error_return(-1, "getting modem status failed");
 
-    *status = (usb_val[1] << 8) | usb_val[0];
+    *status = (usb_val[1] << 8) | (usb_val[0] & 0xFF);
 
     return 0;
 }


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 [email protected]   

Reply via email to