From 0ca7e4c9f1b7f48168f72ddc8b23547b98fe1e31 Mon Sep 17 00:00:00 2001 From: gstellenberg Date: Sun, 12 Jul 2009 22:17:03 -0500 Subject: [PATCH] Replace sleep() with PRSleep() for cross-platform compiling --- utils/pinprocfw/pinprocfw.cpp | 4 +++- utils/pinprocfw/pinprocfw.h | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/utils/pinprocfw/pinprocfw.cpp b/utils/pinprocfw/pinprocfw.cpp index 3d53160..5bc5aba 100644 --- a/utils/pinprocfw/pinprocfw.cpp +++ b/utils/pinprocfw/pinprocfw.cpp @@ -555,7 +555,8 @@ void waitTime(long microsec) // Read the JTAG status register to exercise the USB bus PRJTAGGetStatus(proc, &jtagStatus); - sleep( ( microsec - 2000L ) / 1000000L); + PRSleep( ( microsec - 2000L ) / 1000L); + //sleep( ( microsec - 2000L ) / 1000000L); } else /* Satisfy FPGA JTAG configuration, startup TCK cycles */ { @@ -568,6 +569,7 @@ void waitTime(long microsec) PRJTAGGetStatus(proc, &jtagStatus); } //{ + //PRSleep( ( microsec + 19999L ) / 1000L ); //sleep( ( microsec + 19999L ) / 1000000L ); //sleep( 1 ); //pulseClock(); diff --git a/utils/pinprocfw/pinprocfw.h b/utils/pinprocfw/pinprocfw.h index ece2544..27f0c5b 100644 --- a/utils/pinprocfw/pinprocfw.h +++ b/utils/pinprocfw/pinprocfw.h @@ -13,6 +13,13 @@ #ifndef PINPROCFW_H #define PINPROCFW_H +#if defined(__WIN32__) + #include + #define PRSleep(milliseconds) Sleep(milliseconds) +#else + #define PRSleep(milliseconds) sleep(milliseconds/1000) +#endif + /* Legacy error codes for xsvfExecute from original XSVF player v2.0 */ #define XSVF_LEGACY_SUCCESS 1 #define XSVF_LEGACY_ERROR 0