libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.1-23-g1ad9e4c

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sat, 15 Nov 2014 18:44:26 +0100 (CET)
The branch, master has been updated
       via  1ad9e4cc95b76fa304f6e21723eaf2fb457e0006 (commit)
      from  57f3c6ce1b5942e959ce5107cdbf38ca463ddd59 (commit)


- Log -----------------------------------------------------------------
commit 1ad9e4cc95b76fa304f6e21723eaf2fb457e0006
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date:   Sat Nov 15 18:42:29 2014 +0100

    Remove print_inverted_bits() helper function from public API
    Also fix minor code style issues.
    
    Found during diff session to the previous release.

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

Summary of changes:
 src/ftdi.c |   33 +++++++++++++++++++--------------
 src/ftdi.h |    2 --
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 32b3817..fe146b7 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -3121,6 +3121,21 @@ static unsigned char bit2type(unsigned char bits)
     }
     return 0;
 }
+/* Decode 230X / 232R type chips invert bits
+ * Prints directly to stdout.
+*/
+static void print_inverted_bits(int invert)
+{
+    char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"};
+    int i;
+
+    fprintf(stdout,"Inverted bits:");
+    for (i=0; i<8; i++)
+        if ((invert & (1<<i)) == (1<<i))
+            fprintf(stdout," %s",r_bits[i]);
+
+    fprintf(stdout,"\n");
+}
 /**
    Decode binary EEPROM image into an ftdi_eeprom structure.
 
@@ -3515,8 +3530,9 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int 
verbose)
                 if (eeprom->cbus_function[i]<= CBUSH_AWAKE)
                     fprintf(stdout,"CBUS%d Function: %s\n", i, 
cbush_mux[eeprom->cbus_function[i]]);
             }
-            if(eeprom->invert )
-              print_inverted_bits(eeprom->invert);
+
+            if (eeprom->invert)
+                print_inverted_bits(eeprom->invert);
         }
 
         if (ftdi->type == TYPE_R)
@@ -3528,7 +3544,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int 
verbose)
             char *cbus_BB[] = {"RXF","TXE","RD", "WR"};
 
             if (eeprom->invert)
-              print_inverted_bits(eeprom->invert);
+                print_inverted_bits(eeprom->invert);
 
             for (i=0; i<5; i++)
             {
@@ -4290,15 +4306,4 @@ char *ftdi_get_error_string (struct ftdi_context *ftdi)
     return ftdi->error_str;
 }
 
-void print_inverted_bits(int invert)
-{
-    int i;
-    char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"};
-    fprintf(stdout,"Inverted bits:");
-    for (i=0; i<8; i++)
-        if ((invert & (1<<i)) == (1<<i))
-            fprintf(stdout," %s",r_bits[i]);
-    fprintf(stdout,"\n");
-}
-
 /* @} end of doxygen libftdi group */
diff --git a/src/ftdi.h b/src/ftdi.h
index 66ad7bc..07fcd71 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -554,8 +554,6 @@ extern "C"
 
     char *ftdi_get_error_string(struct ftdi_context *ftdi);
 
-    void print_inverted_bits(int inverted);
-
 #ifdef __cplusplus
 }
 #endif


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. v1.1-23-g1ad9e4c, libftdi-git <=