From 9a58bcee6cb71d2bdcb23e84a8bcff415622ce36 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 12 Dec 2011 22:33:45 +0000 Subject: [PATCH] Mingw has not sleep(), uses WinAPI Sleep(). --- src/LibUsb.cpp | 4 ++++ src/LibUsb.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/LibUsb.cpp b/src/LibUsb.cpp index d2aa4fe5e..cd554387a 100644 --- a/src/LibUsb.cpp +++ b/src/LibUsb.cpp @@ -294,7 +294,11 @@ struct usb_dev_handle* LibUsb::OpenFortius() // Given this is only required /the first time/ the Fortius // is connected, it can't be that bad? if (programmed == true) { +#ifdef WIN32 + Sleep(3000); // windows sleep is in milliseconds +#else sleep(3); // do not be tempted to reduce this, it really does take that long! +#endif usb_find_busses(); usb_find_devices(); } diff --git a/src/LibUsb.h b/src/LibUsb.h index 24db11003..c6bfbe317 100644 --- a/src/LibUsb.h +++ b/src/LibUsb.h @@ -22,6 +22,10 @@ #if defined GC_HAVE_LIBUSB +#ifdef WIN32 +#include +#endif + #include // for the constants etc // EZ-USB firmware loader for Fortius