libftdi-git Archives

Subject: port libftdi to libusb-1.0 branch, master, updated. v0.17-226-g785ddbc

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 19 Jul 2011 18:50:13 +0200 (CEST)
The branch, master has been updated
       via  785ddbca0e3c7e0563822c985a71077a391d3bda (commit)
      from  98c974c72d1fbe7a42b7b911ea8c0edbcf48eec4 (commit)


- Log -----------------------------------------------------------------
commit 785ddbca0e3c7e0563822c985a71077a391d3bda
Author: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date:   Mon Jul 11 15:04:39 2011 +0200

    ftdi_eeprom: Change handling the EEPROM size

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

Summary of changes:
 ftdi_eeprom/main.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c
index fe09efe..151a7d3 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -144,9 +144,8 @@ int main(int argc, char *argv[])
     */
     int _read = 0, _erase = 0, _flash = 0;
 
-    const int my_eeprom_size = 128;                 /* TODO: Kill this. Check 
with Uwe how we can determine the eeprom size properly
-                                                             because it's 
initialized with -1. Maybe assume 128 bytes per default? */
-    unsigned char eeprom_buf[my_eeprom_size];
+    int my_eeprom_size = 0;
+    unsigned char eeprom_buf[FTDI_MAX_EEPROM_SIZE];
     char *filename;
     int size_check;
     int i, argc_filename;
@@ -261,10 +260,10 @@ int main(int argc, char *argv[])
 
         if (i == 0)
         {
-            int chip_size;
-            eeprom_get_value(ftdi, CHIP_SIZE, &chip_size);
+            printf("FTDI read eeprom: %d\n", ftdi_read_eeprom(ftdi));
+            eeprom_get_value(ftdi, CHIP_SIZE, &my_eeprom_size);
             // TODO: Do we know the eeprom size already?
-            printf("EEPROM size: %d\n", chip_size);
+            printf("EEPROM size: %d\n", my_eeprom_size);
         }
         else
         {
@@ -284,7 +283,6 @@ int main(int argc, char *argv[])
 
     if (_read > 0)
     {
-        printf("FTDI read eeprom: %d\n", ftdi_read_eeprom(ftdi));
 
         ftdi_eeprom_decode(ftdi, 0);
         /* Debug output */


hooks/post-receive
-- 
port libftdi to libusb-1.0

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • port libftdi to libusb-1.0 branch, master, updated. v0.17-226-g785ddbc, libftdi-git <=