ftdi_eeprom: reset the device after flashing the eeprom
authorAnders Larsen <al@alarsen.net>
Tue, 3 Jul 2012 21:24:07 +0000 (23:24 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 7 Jul 2012 12:46:32 +0000 (14:46 +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@alarsen.net>

ftdi_eeprom/main.c

index 5127eeb..4eb0f5e 100644 (file)
@@ -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?