Skip to content

Commit 73f9455

Browse files
committed
Fix impedance measurement with usb3
1 parent 87dc3cf commit 73f9455

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

Source/Processors/DataThreads/rhythm-api/rhd2000evalboard.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ void Rhd2000EvalBoard::flush()
13971397
while (numWordsInFifo() > 0) {
13981398
dev->ReadFromBlockPipeOut(PipeOutData, USB3_BLOCK_SIZE, USB3_BLOCK_SIZE *max(2 * numWordsInFifo() / USB3_BLOCK_SIZE, (unsigned int)1), usbBuffer);
13991399
// cout << "Flush phase B: " << numWordsInFifo() << endl;
1400-
printFIFOmetrics();
1400+
// printFIFOmetrics();
14011401
}
14021402
dev->SetWireInValue(WireInResetRun, 0, 1 << 16);
14031403
dev->UpdateWireIns();
@@ -1488,6 +1488,7 @@ bool Rhd2000EvalBoard::readDataBlocks(int numBlocks, queue<Rhd2000DataBlock> &da
14881488
unsigned int numWordsToRead, numBytesToRead;
14891489
int i;
14901490
Rhd2000DataBlock *dataBlock;
1491+
long res;
14911492

14921493
numWordsToRead = numBlocks * dataBlock->calculateDataBlockSizeInWords(numDataStreams, usb3);
14931494

@@ -1502,7 +1503,18 @@ bool Rhd2000EvalBoard::readDataBlocks(int numBlocks, queue<Rhd2000DataBlock> &da
15021503
return false;
15031504
}
15041505

1505-
dev->ReadFromPipeOut(PipeOutData, numBytesToRead, usbBuffer);
1506+
if (usb3)
1507+
{
1508+
res = dev->ReadFromBlockPipeOut(PipeOutData, USB3_BLOCK_SIZE, numBytesToRead, usbBuffer);
1509+
}
1510+
else
1511+
{
1512+
res = dev->ReadFromPipeOut(PipeOutData, numBytesToRead, usbBuffer);
1513+
}
1514+
if (res == ok_Timeout)
1515+
{
1516+
cerr << "CRITICAL: Timeout on pipe read. Check block and buffer sizes." << endl;
1517+
}
15061518

15071519
dataBlock = new Rhd2000DataBlock(numDataStreams, usb3);
15081520
for (i = 0; i < numBlocks; ++i) {

0 commit comments

Comments
 (0)