]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/flasher.c
(dirty) fix for linux to clean up the /dev/ttyACM* quicker
[proxmark3-svn] / client / flasher.c
index f2a8e7c8172e3774a0ef55884f16e656a91c4a17..d1efec5eebdba4f1f77fa060812ad1e136adf76e 100644 (file)
 #include "uart.h"
 #include "usb_cmd.h"
 
+#ifdef _WIN32
+# define unlink(x)
+#endif
+
 static serial_port sp;
 static char* serial_port_name;
 
@@ -62,11 +66,15 @@ void ReceiveCommand(UsbCommand* rxcmd) {
 void CloseProxmark() {
   // Clean up the port
   uart_close(sp);
+  // Fix for linux, it seems that it is extremely slow to release the serial port file descriptor /dev/*
+  unlink(serial_port_name);
 }
 
 int OpenProxmark(size_t i) {
   sp = uart_open(serial_port_name);
   if (sp == INVALID_SERIAL_PORT) {
+    //poll once a second
+    msleep(100);
     return 0;
   }
   return 1;
Impressum, Datenschutz