libftdi Archives

Subject: [PATCH 5/6] ftdi_eeprom: reset the device after flashing the eeprom

From: Anders Larsen <al@xxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 9 Apr 2012 17:29:23 +0200
If we change e.g. the product-id the change will now take effect immediately
without having to unplug/replug the device (which could be soldered in).

Signed-off-by: Anders Larsen <al@xxxxxxxxxxx>
---
 ftdi_eeprom/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c
index aa80992..7a37527 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -38,6 +38,7 @@
 #include <string.h>
 
 #include <confuse.h>
+#include <libusb.h>
 #include <ftdi.h>
 #include <ftdi_eeprom_version.h>
 
@@ -342,6 +343,7 @@ int main(int argc, char *argv[])
             }
         }
         printf ("FTDI write eeprom: %d\n", ftdi_write_eeprom(ftdi));
+        libusb_reset_device(ftdi->usb_dev);
     }
 
     // Write to file?
-- 
1.7.0.4


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

Current Thread