Skip to content

Commit 4398adb

Browse files
committed
Add debug line to packet decoding
1 parent f6048f1 commit 4398adb

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,16 @@ void Rhd2000DataBlock::fillFromUsbBuffer(unsigned char usbBuffer[], int blockInd
142142
{
143143
int index, t, channel, stream, i;
144144
int samplesToRead = nSamples <= 0 ? samplesPerBlock : nSamples;
145+
int num = 0;
145146

146147
index = blockIndex * 2 * calculateDataBlockSizeInWords(numDataStreams, usb3);
147148
for (t = 0; t < samplesToRead; ++t) {
148-
if (!checkUsbHeader(usbBuffer, index)) {
149-
cerr << "Error in Rhd2000EvalBoard::readDataBlock: Incorrect header." << endl;
149+
if (!checkUsbHeader(usbBuffer, index)) {
150+
cerr << "Error in Rhd2000EvalBoard::readDataBlock: Incorrect header." << endl;
150151
break;
151-
}
152+
}
153+
else
154+
num++;
152155
//else cerr << "Block ok" << endl;
153156
index += 8;
154157
timeStamp[t] = convertUsbTimeStamp(usbBuffer, index);
@@ -186,6 +189,7 @@ void Rhd2000DataBlock::fillFromUsbBuffer(unsigned char usbBuffer[], int blockInd
186189
ttlOut[t] = convertUsbWord(usbBuffer, index);
187190
index += 2;
188191
}
192+
cout << "Read " << num << " valid samples with " << numDataStreams << " streams. Usb mode status: " << usb3 << endl;
189193
}
190194

191195
// Print the contents of RHD2000 registers from a selected USB data stream (0-7)

0 commit comments

Comments
 (0)