Skip to content

Commit 9104b09

Browse files
committed
Disable debug messages
1 parent dd89abf commit 9104b09

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

Source/Plugins/IntanRecordingController/RHD2000Thread.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@
4646

4747
#define INIT_STEP 256
4848

49+
//#define SCAN_DEBUG
50+
#ifdef SCAN_DEBUG
51+
#define PRINT_ARRAYS for (int i = 0; i < MAX_NUM_HEADSTAGES; i++) {\
52+
std::cout << "c" << chipId[i] << " t" << tmpChipId[i] << " s" << sumGoodDelays[i] << " if" << indexFirstGoodDelay[i] << " is" << indexSecondGoodDelay[i] << std::endl;}
53+
#define S_DEBUG(x) do { x } while(false);
54+
#else
55+
#define PRINT_ARRAYS {}
56+
#define S_DEBUG(x) {}
57+
#endif
58+
4959
// Allocates memory for a 3-D array of doubles.
5060
void allocateDoubleArray3D(std::vector<std::vector<std::vector<double> > >& array3D,
5161
int xSize, int ySize, int zSize)
@@ -455,9 +465,6 @@ void RHD2000Thread::initializeBoard()
455465

456466
}
457467

458-
#define PRINT_ARRAYS for (int i = 0; i < MAX_NUM_HEADSTAGES; i++) {\
459-
std::cout << "c" << chipId[i] << " t" << tmpChipId[i] << " s" << sumGoodDelays[i] << " if" << indexFirstGoodDelay[i] << " is" << indexSecondGoodDelay[i] << std::endl;}
460-
461468
void RHD2000Thread::scanPorts()
462469
{
463470
if (!deviceFound) //Safety to avoid crashes if board not present
@@ -578,11 +585,11 @@ void RHD2000Thread::scanPorts()
578585
// Record delay settings that yield good communication with the chip.
579586
for (hs = 0; hs < MAX_NUM_HEADSTAGES; ++hs)//MAX_NUM_DATA_STREAMS; ++stream)
580587
{
581-
std::cout << "Stream number " << hs << ", delay = " << delay << std::endl;
582-
dataBlock->print(hs);
588+
S_DEBUG(std::cout << "Stream number " << hs << ", delay = " << delay << std::endl;
589+
dataBlock->print(hs);)
583590

584591
id = deviceId(dataBlock, hs, register59Value);
585-
std::cout << "h " << hs << " id " << id << std::endl;
592+
S_DEBUG(std::cout << "h " << hs << " id " << id << std::endl;)
586593

587594
if (id == CHIP_ID_RHD2132 || id == CHIP_ID_RHD2216 ||
588595
(id == CHIP_ID_RHD2164 && register59Value == REGISTER_59_MISO_A))
@@ -605,21 +612,23 @@ void RHD2000Thread::scanPorts()
605612
}
606613
}
607614
PRINT_ARRAYS;
615+
S_DEBUG(
608616
std::cout << "s: " << enabledStreams.size() << std::endl;
609617
for (int i = 0; i < enabledStreams.size(); i++)
610618
std::cout << "s " << enabledStreams[i];
611619

612620
std::cout << "n: " << numChannelsPerDataStream.size() << std::endl;
613621
for (int i = 0; i < numChannelsPerDataStream.size(); i++)
614622
std::cout << "n " << numChannelsPerDataStream[i];
623+
)
615624
// Now, disable data streams where we did not find chips present.
616625
int chipIdx = 0;
617626
for (hs = 0; hs < MAX_NUM_HEADSTAGES; ++hs)
618627
{
619628
if ((tmpChipId[hs] > 0) && (enabledStreams.size() < MAX_NUM_DATA_STREAMS))
620629
{
621630
chipId.set(chipIdx++,tmpChipId[hs]);
622-
std::cout << "Enabling headstage on stream " << hs << std::endl;
631+
S_DEBUG(std::cout << "Enabling headstage on stream " << hs << std::endl;)
623632
if (tmpChipId[hs] == CHIP_ID_RHD2164) //RHD2164
624633
{
625634
if (enabledStreams.size() < MAX_NUM_DATA_STREAMS - 1)
@@ -639,18 +648,19 @@ void RHD2000Thread::scanPorts()
639648
}
640649
else
641650
{
642-
std::cout << "Disabling headstage on stream " << hs << std::endl;
651+
S_DEBUG(std::cout << "Disabling headstage on stream " << hs << std::endl;)
643652
enableHeadstage(hs, false);
644653
}
645654
}
655+
S_DEBUG(
646656
std::cout << "s: " << enabledStreams.size() << std::endl;
647657
for (int i = 0; i < enabledStreams.size(); i++)
648658
std::cout << "s " << enabledStreams[i];
649659

650660
std::cout << "n: " << numChannelsPerDataStream.size() << std::endl;
651661
for (int i = 0; i < numChannelsPerDataStream.size(); i++)
652662
std::cout << "n " << numChannelsPerDataStream[i];
653-
663+
)
654664
// for (int i = 0; i < 16; i++)
655665
// enableHeadstage(i, true, 2, 32);
656666
updateBoardStreams();

Source/Plugins/IntanRecordingController/rhythm-api/rhd2000evalboardusb3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,9 @@ bool Rhd2000EvalBoardUsb3::readDataBlock(Rhd2000DataBlockUsb3 *dataBlock, int nS
14711471
"Increase value of MAX_NUM_BLOCKS." << endl;
14721472
return false;
14731473
}
1474-
std::cout << " Reading " << nSamples << " samples " << numBytesToRead << " bytes with block size " << USB3_BLOCK_SIZE << std::endl;
1474+
//std::cout << " Reading " << nSamples << " samples " << numBytesToRead << " bytes with block size " << USB3_BLOCK_SIZE << std::endl;
14751475
result = dev->ReadFromBlockPipeOut(PipeOutData, USB3_BLOCK_SIZE, USB3_BLOCK_SIZE * max(numBytesToRead / USB3_BLOCK_SIZE, (unsigned int)1), usbBuffer);
1476-
std::cout << "Read " << result << std::endl;
1476+
//std::cout << "Read " << result << std::endl;
14771477
if (result == ok_Failed) {
14781478
cerr << "CRITICAL (readDataBlock): Failure on pipe read. Check block and buffer sizes." << endl;
14791479
} else if (result == ok_Timeout) {

0 commit comments

Comments
 (0)