diff --git a/Source/devices/oni/AcqBoardONI.cpp b/Source/devices/oni/AcqBoardONI.cpp index 3e0da46..888a0c5 100644 --- a/Source/devices/oni/AcqBoardONI.cpp +++ b/Source/devices/oni/AcqBoardONI.cpp @@ -147,8 +147,8 @@ bool AcqBoardONI::detectBoard() { LOGC ("Open Ephys ECP5-ONI FPGA open. Gateware version v", major, ".", minor, ".", patch); } - hasI2cSupport = major >= 1 && minor >= 5; - hasMemoryMonitorSupport = major >= 1 && minor >= 5 && patch >= 1; + hasI2cSupport = CheckSemVer (major, minor, patch, 1, 5, 0); + hasMemoryMonitorSupport = CheckSemVer (major, minor, patch, 1, 5, 1); if (major == 0) { @@ -2177,3 +2177,21 @@ bool AcqBoardONI::getMemoryMonitorSupport() const { return hasMemoryMonitorSupport; } + +bool AcqBoardONI::CheckSemVer (int major, int minor, int patch, int targetMajor, int targetMinor, int targetPatch) +{ + if (major > targetMajor) + return true; + else if (major < targetMajor) + return false; + + if (minor > targetMinor) + return true; + else if (minor < targetMinor) + return false; + + if(patch >= targetPatch) + return true; + + return false; +} \ No newline at end of file diff --git a/Source/devices/oni/AcqBoardONI.h b/Source/devices/oni/AcqBoardONI.h index dee2ce8..3b1d235 100644 --- a/Source/devices/oni/AcqBoardONI.h +++ b/Source/devices/oni/AcqBoardONI.h @@ -364,6 +364,8 @@ class AcqBoardONI : public AcquisitionBoard DataBuffer* memBuffer = nullptr; Array bnoBuffers; + + static bool CheckSemVer (int major, int minor, int patch, int targetMajor, int targetMinor, int targetPatch); }; #endif