examples/eeprom.c: use AUTO_DETACH_REATACH_SIO_MODULE
authorYegor Yefremov <yegorslists@googlemail.com>
Thu, 31 Aug 2023 07:07:51 +0000 (09:07 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Fri, 1 Sep 2023 16:09:36 +0000 (18:09 +0200)
This way, the device's state remains unchanged after the
eeprom invocation.

Bonus: remove trailing white spaces.

examples/eeprom.c

index 45f5dff..3d03ac3 100644 (file)
@@ -90,6 +90,8 @@ int main(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
+    ftdi->module_detach_mode = AUTO_DETACH_REATACH_SIO_MODULE;
+
     while ((i = getopt(argc, argv, "d::ev:p:l:P:S:w")) != -1)
     {
         switch (i)
@@ -200,7 +202,7 @@ int main(int argc, char **argv)
             fprintf(stderr, "\n");
             fprintf(stderr, "unable to open ftdi device: %d (%s)\n",
                     f, ftdi_get_error_string(ftdi));
-            
+
             retval = -1;
             goto done;
         }