1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Replace sleep() with PRSleep() for cross-platform compiling

This commit is contained in:
gstellenberg
2009-07-12 22:17:03 -05:00
parent 583b7113c5
commit 0ca7e4c9f1
2 changed files with 10 additions and 1 deletions

View File

@@ -555,7 +555,8 @@ void waitTime(long microsec)
// Read the JTAG status register to exercise the USB bus // Read the JTAG status register to exercise the USB bus
PRJTAGGetStatus(proc, &jtagStatus); PRJTAGGetStatus(proc, &jtagStatus);
sleep( ( microsec - 2000L ) / 1000000L); PRSleep( ( microsec - 2000L ) / 1000L);
//sleep( ( microsec - 2000L ) / 1000000L);
} }
else /* Satisfy FPGA JTAG configuration, startup TCK cycles */ else /* Satisfy FPGA JTAG configuration, startup TCK cycles */
{ {
@@ -568,6 +569,7 @@ void waitTime(long microsec)
PRJTAGGetStatus(proc, &jtagStatus); PRJTAGGetStatus(proc, &jtagStatus);
} }
//{ //{
//PRSleep( ( microsec + 19999L ) / 1000L );
//sleep( ( microsec + 19999L ) / 1000000L ); //sleep( ( microsec + 19999L ) / 1000000L );
//sleep( 1 ); //sleep( 1 );
//pulseClock(); //pulseClock();

View File

@@ -13,6 +13,13 @@
#ifndef PINPROCFW_H #ifndef PINPROCFW_H
#define PINPROCFW_H #define PINPROCFW_H
#if defined(__WIN32__)
#include <windows.h>
#define PRSleep(milliseconds) Sleep(milliseconds)
#else
#define PRSleep(milliseconds) sleep(milliseconds/1000)
#endif
/* Legacy error codes for xsvfExecute from original XSVF player v2.0 */ /* Legacy error codes for xsvfExecute from original XSVF player v2.0 */
#define XSVF_LEGACY_SUCCESS 1 #define XSVF_LEGACY_SUCCESS 1
#define XSVF_LEGACY_ERROR 0 #define XSVF_LEGACY_ERROR 0