Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/OpenEphysLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
{
info->apiVersion = PLUGIN_API_VER;
info->name = "Acquisition Board";
info->libVersion = "1.1.4";
info->libVersion = "1.1.5";
info->numPlugins = NUM_PLUGINS;
}

Expand Down
18 changes: 10 additions & 8 deletions Source/devices/oni/AcqBoardONI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ bool AcqBoardONI::initializeBoardInThread()
// - disables all DACs and sets gain to 0
LOGDD ("DBG: 1");

checkCableDelays = false;
setSampleRate (30000);
setSampleRate (30000, false);

LOGDD ("DBG: A");
evalBoard->setCableLengthMeters (Rhd2000ONIBoard::PortA, settings.cableLength.portA);
Expand Down Expand Up @@ -521,7 +520,12 @@ Array<int> AcqBoardONI::getAvailableSampleRates()
return sampleRates;
}

void AcqBoardONI::setSampleRate (int desiredSampleRate)
void AcqBoardONI::setSampleRate(int desiredSampleRate)
{
setSampleRate (desiredSampleRate, true);
}

void AcqBoardONI::setSampleRate (int desiredSampleRate, bool reScanDelays)
{
Rhd2000ONIBoard::AmplifierSampleRate sampleRate;

Expand Down Expand Up @@ -614,7 +618,7 @@ void AcqBoardONI::setSampleRate (int desiredSampleRate)
}
LOGD ("Sample rate set to ", evalBoard->getSampleRate());

if (checkCableDelays)
if (reScanDelays)
{
checkAllCableDelays();
}
Expand Down Expand Up @@ -1018,8 +1022,7 @@ void AcqBoardONI::scanPortsInThread()

float currentSampleRate = settings.boardSampleRate;

checkCableDelays = false;
setSampleRate (30000); // set to 30 kHz temporarily
setSampleRate (30000, false); // set to 30 kHz temporarily

LOGDD ("DBG: SC");
// Enable all data streams, and set sources to cover one or two chips
Expand Down Expand Up @@ -1225,8 +1228,7 @@ void AcqBoardONI::scanPortsInThread()
LOGD ("Set optimum delay for port C: ", settings.optimumDelay.portC);
LOGD ("Set optimum delay for port D: ", settings.optimumDelay.portD);

checkCableDelays = ! initialScan;
setSampleRate (currentSampleRate); // restore saved sample rate and check delays
setSampleRate (currentSampleRate, !initialScan); // restore saved sample rate and check delays

initialScan = false;
}
Expand Down
8 changes: 4 additions & 4 deletions Source/devices/oni/AcqBoardONI.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class AcqBoardONI : public AcquisitionBoard
Array<int> getAvailableSampleRates();

/** Set sample rate */
void setSampleRate (int sampleRateHz);
void setSampleRate (int sampleRateHz) override;

/** Get current sample rate */
float getSampleRate() const;
Expand Down Expand Up @@ -245,6 +245,9 @@ class AcqBoardONI : public AcquisitionBoard
bool getMemoryMonitorSupport() const;

private:
/** Sets sample rate and updates delays*/
void setSampleRate (int sampleRateHz, bool reScanDelays);

/**Check board memory status */
bool checkBoardMem() const;

Expand Down Expand Up @@ -326,9 +329,6 @@ class AcqBoardONI : public AcquisitionBoard
/** Lock for interacting with board */
CriticalSection oniLock;

/** Re-check cable delays after changing sample rate*/
bool checkCableDelays = false;

/** Hold the current device ID.Used to determine which version of the acquisition board this is */
int deviceId = 0;

Expand Down