libftdi1: Fixe Fixme in CBUS decoding
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Fri, 20 May 2011 16:07:37 +0000 (18:07 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 23 May 2011 15:56:12 +0000 (17:56 +0200)
>>>>> "Thomas" == Thomas Jarosch <thomas.jarosch@intra2net.com> writes:

    Thomas> Uwe, On Friday, 20. May 2011 12:43:42 Uwe Bonnes wrote:
    >> as I am still in the steep part of the learning curve with git, at
    >> some point in time I accidently merged my changes to streaming read
    >> and eeprom to one. That way, my tree diverged from either libftdi-1.0
    >> master and eeprom- new. As I need both features, maintainance is
    >> difficult.
    >>
    >> Two questions: Why is eeprom-new still not merged?

    Thomas> It is now.

Thanks

Appended patch hopefully fixes the FIXME aimed at me.

Bye
--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 92ec6ded6df5aa377e1f82c081891b321f22c1d0 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Date: Fri, 20 May 2011 18:03:21 +0200
Subject: Only the first 4 PINs have (fixed) CBUS functionality

src/ftdi.c

index c53d7aa..8eff4a0 100644 (file)
@@ -2961,13 +2961,13 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose)
                             cbus_mux[eeprom->cbus_function[i]]);
                 else
                 {
-                    /* FIXME for Uwe: This results in an access above array bounds.
-                       Also I couldn't find documentation about this mode.
-                    fprintf(stdout,"C%d BB Function: %s\n", i,
-                            cbus_BB[i]);
-                    */
-                    fprintf(stdout, "Unknown CBUS mode. Might be special mode?\n");
-                    (void)cbus_BB;
+                    if (i < 4)
+                        /* Running MPROG show that C0..3 have fixed function Synchronous
+                           Bit Bang mode */
+                        fprintf(stdout,"C%d BB Function: %s\n", i,
+                                cbus_BB[i]);
+                    else
+                        fprintf(stdout, "Unknown CBUS mode. Might be special mode?\n");
                 }
             }
         }