diff options
Diffstat (limited to 'commandline/library')
-rw-r--r-- | commandline/library/littleWire_util.c | 9 | ||||
-rw-r--r-- | commandline/library/littleWire_util.h | 6 | ||||
-rw-r--r-- | commandline/library/micronucleus_lib.h | 6 | ||||
-rw-r--r-- | commandline/library/opendevice.h | 7 |
4 files changed, 15 insertions, 13 deletions
diff --git a/commandline/library/littleWire_util.c b/commandline/library/littleWire_util.c index d711302..940a68d 100644 --- a/commandline/library/littleWire_util.c +++ b/commandline/library/littleWire_util.c @@ -1,12 +1,13 @@ - #include <littleWire_util.h> /* Delay in miliseconds */ void delay(unsigned int duration) { - #ifdef LINUX - usleep(duration*1000); - #else + #if defined _WIN32 || defined _WIN64 + // use windows sleep api with milliseconds Sleep(duration); + #else + // use standard unix api with microseconds + usleep(duration*1000); #endif } diff --git a/commandline/library/littleWire_util.h b/commandline/library/littleWire_util.h index dac8623..27dc172 100644 --- a/commandline/library/littleWire_util.h +++ b/commandline/library/littleWire_util.h @@ -1,10 +1,10 @@ #ifndef LITTLEWIRE_UTIL_H #define LITTLEWIRE_UTIL_H -#ifdef LINUX - #include <unistd.h> +#if defined WIN + #include <windows.h> #else - #include <windows.h> + #include <unistd.h> #endif /* Delay in miliseconds */ diff --git a/commandline/library/micronucleus_lib.h b/commandline/library/micronucleus_lib.h index 8a004e4..b724a60 100644 --- a/commandline/library/micronucleus_lib.h +++ b/commandline/library/micronucleus_lib.h @@ -27,10 +27,10 @@ /******************************************************************************** * Header files ********************************************************************************/ -#if defined(LINUX) - #include <usb.h> // this is libusb, see http://libusb.sourceforge.net/ -#else +#if defined WIN #include <lusb0_usb.h> // this is libusb, see http://libusb.sourceforge.net/ +#else + #include <usb.h> // this is libusb, see http://libusb.sourceforge.net/ #endif #include "opendevice.h" // common code moved to separate module /*******************************************************************************/ diff --git a/commandline/library/opendevice.h b/commandline/library/opendevice.h index a23ed41..f687ccd 100644 --- a/commandline/library/opendevice.h +++ b/commandline/library/opendevice.h @@ -23,11 +23,12 @@ files according to the GNU General Public License (GPL) version 2 or 3. #ifndef __OPENDEVICE_H_INCLUDED__ #define __OPENDEVICE_H_INCLUDED__ -#if defined(LINUX) - #include <usb.h> // this is libusb, see http://libusb.sourceforge.net/ +#if defined WIN + #include <lusb0_usb.h> // this is libusb, see http://libusb.sourceforge.net/ #else - #include <lusb0_usb.h> // this is libusb, see http://libusb.sourceforge.net/ + #include <usb.h> // this is libusb, see http://libusb.sourceforge.net/ #endif + #include <stdio.h> int usbGetStringAscii(usb_dev_handle *dev, int index, char *buf, int buflen); |