libftdi-git Archives

Subject: port libftdi to libusb-1.0 branch, master, updated. v0.17-241-g94c637b

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 2 Sep 2011 14:01:41 +0200 (CEST)
The branch, master has been updated
       via  94c637b8aa9c19a1e8a669249f07624bda5d5270 (commit)
      from  c4517f98b9cd913b848d5257ad59b4db4842fbdb (commit)


- Log -----------------------------------------------------------------
commit 94c637b8aa9c19a1e8a669249f07624bda5d5270
Author: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date:   Wed Aug 31 18:09:44 2011 +0200

    ftdi_eeprom: If we don't understand the argument, tell the user and abort

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

Summary of changes:
 ftdi_eeprom/main.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c
index 950bad7..a765d8c 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -170,11 +170,15 @@ int main(int argc, char *argv[])
     {
         if (strcmp(argv[1], "--read-eeprom") == 0)
             _read = 1;
-        if (strcmp(argv[1], "--erase-eeprom") == 0)
+        else if (strcmp(argv[1], "--erase-eeprom") == 0)
             _erase = 1;
-        if (strcmp(argv[1], "--flash-eeprom") == 0)
+        else if (strcmp(argv[1], "--flash-eeprom") == 0)
             _flash = 1;
-
+        else
+        {
+            printf ("Can't open configuration file\n");
+            exit (-1);
+        }
         argc_filename = 2;
     }
     else
@@ -213,9 +217,6 @@ int main(int argc, char *argv[])
         if (i == 0)
         {
             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", my_eeprom_size);
         }
         else
         {
@@ -231,6 +232,9 @@ int main(int argc, char *argv[])
                 exit (-1);
             }
         }
+        eeprom_get_value(ftdi, CHIP_SIZE, &my_eeprom_size);
+        // TODO: Do we know the eeprom size already?
+        printf("EEPROM size: %d\n", my_eeprom_size);
     }
 
     if (_read > 0)


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-241-g94c637b, libftdi-git <=