Skip to content
Snippets Groups Projects
Commit 742408ea authored by Josh Siegle's avatar Josh Siegle
Browse files

Use Opal Kelly library to reset FPGA after use.

This should help reduce overheating.
parent c793da03
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn), isTransmitting(fa
dataBuffer = new DataBuffer(2, 10000); // start with 2 channels and automatically resize
// Open Opal Kelly XEM6010 board.
// Returns 1 if successful, -1 if FrontPanel cannot be loaded, and -2 if XEM6010 can't be found.
int return_code = evalBoard->open();
if (return_code == 1)
......@@ -54,7 +55,7 @@ RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn), isTransmitting(fa
initializeBoard();
// automatically find connected headstages
scanPorts(); // do this after the editor has been created?
scanPorts(); // things would run more smoothly if this were done after the editor has been created
}
}
......@@ -70,6 +71,9 @@ RHD2000Thread::~RHD2000Thread()
evalBoard->setLedDisplay(ledArray);
}
if (deviceFound)
evalBoard->resetFpga();
deleteAndZero(dataBlock);
}
......
......@@ -173,6 +173,12 @@ bool Rhd2000EvalBoard::uploadFpgaBitfile(string filename)
return(true);
}
// Uses the Opal Kelly library to reset the FPGA
void Rhd2000EvalBoard::resetFpga()
{
dev->ResetFPGA();
}
// Reads system clock frequency from Opal Kelly board (in MHz). Should be 100 MHz for normal
// Rhythm operation.
double Rhd2000EvalBoard::getSystemClockFreq() const
......
......@@ -153,6 +153,8 @@ public:
bool readDataBlocks(int numBlocks, queue<Rhd2000DataBlock> &dataQueue);
int queueToFile(queue<Rhd2000DataBlock> &dataQueue, std::ofstream& saveOut);
void resetFpga();
private:
okCFrontPanel* dev;
AmplifierSampleRate sampleRate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment