libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v0.17-16-g4aee4ad

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 14 Jun 2010 09:20:56 +0200 (CEST)
The branch, master has been updated
       via  4aee4ad2acf69807605ced163e54667265100273 (commit)
      from  8cb3662899f555fb424668e1726c9b3e1e41f7e8 (commit)


- Log -----------------------------------------------------------------
commit 4aee4ad2acf69807605ced163e54667265100273
Author: Wilfried Holzke <libftdi@xxxxxxxxxx>
Date:   Mon Jun 14 09:20:14 2010 +0200

    Add ftdi_eeprom_free() to free allocated memory in eeprom

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

Summary of changes:
 AUTHORS    |    1 +
 src/ftdi.c |   21 +++++++++++++++++++++
 src/ftdi.h |    1 +
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 506ff18..9aed93e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -38,3 +38,4 @@ see Changelog for full details:
   Thomas Fischl <fischl@xxxxxxxxx>
   Tim Ansell <mithro@xxxxxxxxxx>
   Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
+  Wilfried Holzke <libftdi@xxxxxxxxxx>
diff --git a/src/ftdi.c b/src/ftdi.c
index 756e6b7..4d10b73 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -2132,6 +2132,27 @@ void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom)
 }
 
 /**
+    Frees allocated memory in eeprom.
+
+    \param eeprom Pointer to ftdi_eeprom
+*/
+void ftdi_eeprom_free(struct ftdi_eeprom *eeprom)
+{
+    if (eeprom->manufacturer != 0) {
+        free(eeprom->manufacturer);
+        eeprom->manufacturer = 0;
+    }
+    if (eeprom->product != 0) {
+        free(eeprom->product);
+        eeprom->product = 0;
+    }
+    if (eeprom->serial != 0) {
+        free(eeprom->serial);
+        eeprom->serial = 0;
+    }
+}
+
+/**
     Build binary output from ftdi_eeprom structure.
     Output is suitable for ftdi_write_eeprom().
 
diff --git a/src/ftdi.h b/src/ftdi.h
index 810e074..24a7f5b 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -352,6 +352,7 @@ extern "C"
 
     /* init and build eeprom from ftdi_eeprom structure */
     void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom);
+    void ftdi_eeprom_free(struct ftdi_eeprom *eeprom);
     int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
     int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, 
int size);
 


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. v0.17-16-g4aee4ad, libftdi-git <=