libftdi Archives

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

From: Anders Larsen <al@xxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 3 Jul 2012 23:24:07 +0200
If we change e.g. the product-id the change will take effect immediately
without having to unplug/replug the device.

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 5127eeb..4eb0f5e 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -37,6 +37,7 @@
 #include <string.h>
 
 #include <confuse.h>
+#include <libusb.h>
 #include <ftdi.h>
 #include <ftdi_eeprom_version.h>
 
@@ -352,6 +353,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