mirror of
https://github.com/preble/libpinproc
synced 2026-02-22 18:15:25 +01:00
Resolved a number of build issues with WIN32 builds
This commit is contained in:
@@ -39,7 +39,9 @@
|
||||
#if defined(PR_BUILDING_PR)
|
||||
#define PR_EXPORT __declspec(dllexport) extern
|
||||
#else
|
||||
#define PR_EXPORT __declspec(dllimport) extern
|
||||
// TODO: Decide what to do here:
|
||||
//#define PR_EXPORT __declspec(dllimport) extern
|
||||
#define PR_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -525,7 +525,7 @@ PRResult PRDevice::SwitchGetStates( PREventType * switchStates, uint16_t numSwit
|
||||
// Wait for data to return. Give it 10 loops before giving up.
|
||||
while (requestedDataQueue.size() < numWords && i++ < 10)
|
||||
{
|
||||
sleep (.01); // 10 milliseconds should be plenty of time.
|
||||
PRSleep (10); // 10 milliseconds should be plenty of time.
|
||||
SortReturningData();
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ PRResult PRDevice::VerifyChipID()
|
||||
max_count = 0;
|
||||
//std::cout << "Waiting for read data ";
|
||||
while (num_collected_bytes < (bufferWords*4) && max_count < 10) {
|
||||
sleep(.01);
|
||||
PRSleep(10);
|
||||
//std::cout << ". ";
|
||||
rc = CollectReadData();
|
||||
max_count++;
|
||||
@@ -809,7 +809,7 @@ PRResult PRDevice::ReadDataRaw(uint32_t moduleSelect, uint32_t startingAddr, int
|
||||
// Expect numReadWords + 1 word with the address.
|
||||
while (requestedDataQueue.size() < (numReadWords + 1) && i++ < 10)
|
||||
{
|
||||
sleep (.01); // 10 milliseconds should be plenty of time.
|
||||
PRSleep (10); // 10 milliseconds should be plenty of time.
|
||||
SortReturningData();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,13 @@
|
||||
#include <stdint.h>
|
||||
#include "../include/pinproc.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#include <windows.h>
|
||||
#define PRSleep(milliseconds) Sleep(milliseconds)
|
||||
#else
|
||||
#define PRSleep(milliseconds) sleep(milliseconds/1000)
|
||||
#endif
|
||||
|
||||
const int32_t FTDI_VENDOR_ID = 0x0403;
|
||||
const int32_t FTDI_FT245RL_PRODUCT_ID = 0x6001;
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#include "../include/pinproc.h"
|
||||
#include "PRDevice.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#include <stardg.h>
|
||||
#endif
|
||||
|
||||
#define MAX_TEXT (1024)
|
||||
|
||||
typedef void (*PRLogCallback)(PRLogLevel level, const char *text);
|
||||
|
||||
Reference in New Issue
Block a user