mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Minor improvements. Fixed PRSleep() on POSIX platforms.
This commit is contained in:
4
Makefile
4
Makefile
@@ -3,8 +3,8 @@ AR = ar
|
|||||||
ARFLAGS = rc
|
ARFLAGS = rc
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
CFLAGS=$(ARCH) -c -Wall -Iinclude
|
CFLAGS=$(ARCH) $(OTHER_CFLAGS) -c -Wall -Iinclude
|
||||||
LDFLAGS=$(ARCH)
|
LDFLAGS=$(ARCH) $(OTHER_LDFLAGS)
|
||||||
|
|
||||||
LIBPINPROC = bin/libpinproc.a
|
LIBPINPROC = bin/libpinproc.a
|
||||||
SRCS = src/pinproc.cpp src/PRDevice.cpp src/PRHardware.cpp
|
SRCS = src/pinproc.cpp src/PRDevice.cpp src/PRHardware.cpp
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ PRResult PRDevice::SwitchUpdateConfig(PRSwitchConfig *switchConfig)
|
|||||||
this->switchConfig = *switchConfig;
|
this->switchConfig = *switchConfig;
|
||||||
CreateSwitchUpdateConfigBurst(burst, switchConfig);
|
CreateSwitchUpdateConfigBurst(burst, switchConfig);
|
||||||
|
|
||||||
DEBUG(PRLog(kPRLogInfo, "Configuring Switch Logic"));
|
DEBUG(PRLog(kPRLogInfo, "Configuring Switch Logic\n"));
|
||||||
DEBUG(PRLog(kPRLogVerbose, "Words: %x %x\n",burst[0],burst[1]));
|
DEBUG(PRLog(kPRLogVerbose, "Words: %x %x\n",burst[0],burst[1]));
|
||||||
|
|
||||||
rc = PrepareWriteData(burst, burstWords);
|
rc = PrepareWriteData(burst, burstWords);
|
||||||
@@ -760,7 +760,7 @@ int32_t PRDevice::DMDUpdateConfig(PRDMDConfig *dmdConfig)
|
|||||||
this->dmdConfig = *dmdConfig;
|
this->dmdConfig = *dmdConfig;
|
||||||
CreateDMDUpdateConfigBurst(burst, dmdConfig);
|
CreateDMDUpdateConfigBurst(burst, dmdConfig);
|
||||||
|
|
||||||
DEBUG(PRLog(kPRLogInfo, "Configuring DMD"));
|
DEBUG(PRLog(kPRLogInfo, "Configuring DMD\n"));
|
||||||
DEBUG(PRLog(kPRLogVerbose, "Words: %x %x %x %x %x %x %x\n",burst[0],burst[1],burst[2],burst[3],
|
DEBUG(PRLog(kPRLogVerbose, "Words: %x %x %x %x %x %x %x\n",burst[0],burst[1],burst[2],burst[3],
|
||||||
burst[4],burst[5],burst[6]));
|
burst[4],burst[5],burst[6]));
|
||||||
|
|
||||||
@@ -963,20 +963,21 @@ PRResult PRDevice::VerifyChipID()
|
|||||||
uint32_t buffer[bufferWords];
|
uint32_t buffer[bufferWords];
|
||||||
//uint32_t temp_word;
|
//uint32_t temp_word;
|
||||||
uint32_t max_count, i;
|
uint32_t max_count, i;
|
||||||
|
const uint32_t max_count_limit = 10;
|
||||||
|
|
||||||
//std::cout << "Requesting FPGA Chip ID: ";
|
//std::cout << "Requesting FPGA Chip ID: ";
|
||||||
rc = RequestData(P_ROC_MANAGER_SELECT, P_ROC_REG_CHIP_ID_ADDR, 4);
|
rc = RequestData(P_ROC_MANAGER_SELECT, P_ROC_REG_CHIP_ID_ADDR, 4);
|
||||||
|
|
||||||
max_count = 0;
|
max_count = 0;
|
||||||
// Wait for data to return. Give it 10 loops before giving up.
|
// Wait for data to return. Give it 10 loops before giving up.
|
||||||
while (requestedDataQueue.size() < 5 && max_count++ < 10)
|
while (requestedDataQueue.size() < 5 && max_count++ < max_count_limit)
|
||||||
{
|
{
|
||||||
PRSleep (10); // 10 milliseconds should be plenty of time.
|
PRSleep (10); // 10 milliseconds should be plenty of time.
|
||||||
if (SortReturningData() != kPRSuccess)
|
if (SortReturningData() != kPRSuccess)
|
||||||
return kPRFailure;
|
return kPRFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_count != 11) {
|
if (max_count != max_count_limit+1) {
|
||||||
|
|
||||||
if (requestedDataQueue.size() == 5) {
|
if (requestedDataQueue.size() == 5) {
|
||||||
for (i = 0; i < bufferWords; i++) {
|
for (i = 0; i < bufferWords; i++) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define PRSleep(milliseconds) Sleep(milliseconds)
|
#define PRSleep(milliseconds) Sleep(milliseconds)
|
||||||
#else
|
#else
|
||||||
#define PRSleep(milliseconds) sleep(milliseconds/1000)
|
#define PRSleep(milliseconds) usleep(milliseconds*1000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int32_t FTDI_VENDOR_ID = 0x0403;
|
const int32_t FTDI_VENDOR_ID = 0x0403;
|
||||||
|
|||||||
Reference in New Issue
Block a user