From: Uwe Bonnes Date: Fri, 20 May 2011 16:07:37 +0000 (+0200) Subject: libftdi1: Fixe Fixme in CBUS decoding X-Git-Tag: v1.0rc1~132 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=598b233449d6dee441640a9603ceaff3ee327379 libftdi1: Fixe Fixme in CBUS decoding >>>>> "Thomas" == Thomas Jarosch 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 Date: Fri, 20 May 2011 18:03:21 +0200 Subject: Only the first 4 PINs have (fixed) CBUS functionality --- diff --git a/src/ftdi.c b/src/ftdi.c index c53d7aa..8eff4a0 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -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"); } } }