diff --git a/Builds/VisualStudio2012/open-ephys.sln b/Builds/VisualStudio2012/open-ephys.sln index 61074c0e04aebb4f1d48dd95b47ccd0a86ed9f09..520a8d855d09a997cfccb769049bb0e4c270ef34 100644 --- a/Builds/VisualStudio2012/open-ephys.sln +++ b/Builds/VisualStudio2012/open-ephys.sln @@ -1,21 +1,29 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 -Project("{5A05F353-1D63-394C-DFB0-981BB2309002}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Debug64|Win32 = Debug64|Win32 Debug64|x64 = Debug64|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release64|Win32 = Release64|Win32 Release64|x64 = Release64|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.ActiveCfg = Debug|Win32 {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.Build.0 = Debug|Win32 - {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32 - {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|x64.ActiveCfg = Debug|Win32 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|Win32.ActiveCfg = Debug64|x64 {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64 {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|x64.ActiveCfg = Release|Win32 + {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|Win32.ActiveCfg = Release64|x64 {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.ActiveCfg = Release64|x64 {9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.Build.0 = Release64|x64 EndGlobalSection diff --git a/Source/Processors/DataThreads/RHD2000Thread.cpp b/Source/Processors/DataThreads/RHD2000Thread.cpp index 009df8154ea73e6cb311c1cb48be8d1f8af74a3d..920cbb89e80e17f9569ce5cb992172ec3de2e5ad 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.cpp +++ b/Source/Processors/DataThreads/RHD2000Thread.cpp @@ -34,7 +34,13 @@ #define okLIB_NAME "./libokFrontPanel.so" #define okLIB_EXTENSION "*.so" #endif + +#define CHIP_ID_RHD2132 1 +#define CHIP_ID_RHD2216 2 +#define CHIP_ID_RHD2164 4 #define CHIP_ID_RHD2164_B 1000 +#define REGISTER_59_MISO_A 53 +#define REGISTER_59_MISO_B 58 // Allocates memory for a 3-D array of doubles. void allocateDoubleArray3D(std::vector<std::vector<std::vector<double> > >& array3D, @@ -394,6 +400,7 @@ void RHD2000Thread::scanPorts() // Scan SPI ports int delay, stream, id; + int register59Value; //int numChannelsOnPort[4] = {0, 0, 0, 0}; Rhd2000EvalBoard::BoardDataSource initStreamPorts[8] = { @@ -503,9 +510,10 @@ void RHD2000Thread::scanPorts() { // std::cout << "Stream number " << stream << ", delay = " << delay << std::endl; - id = deviceId(dataBlock, stream); + id = deviceId(dataBlock, stream, register59Value); - if (id > 0) // 1 = RHD2132, 2 = RHD2216 + if (id == CHIP_ID_RHD2132 || id == CHIP_ID_RHD2216 || + (id == CHIP_ID_RHD2164 && register59Value == REGISTER_59_MISO_A)) { // std::cout << "Device ID found: " << id << std::endl; @@ -552,7 +560,7 @@ void RHD2000Thread::scanPorts() if (chipId[stream] > 0) { //std::cout << "Enabling headstage on stream " << stream << std::endl; - if (chipId[stream] == 4) //RHD2164 + if (chipId[stream] == CHIP_ID_RHD2164) //RHD2164 { //We just add it like a second headstage, allowing only one RHD2164 per channel //This would need to change @@ -616,7 +624,7 @@ void RHD2000Thread::scanPorts() updateRegisters(); } -int RHD2000Thread::deviceId(Rhd2000DataBlock* dataBlock, int stream) +int RHD2000Thread::deviceId(Rhd2000DataBlock* dataBlock, int stream, int ®ister59Value) { bool intanChipPresent; @@ -639,10 +647,12 @@ int RHD2000Thread::deviceId(Rhd2000DataBlock* dataBlock, int stream) // chip ID number stored in ROM regstier 63. if (!intanChipPresent) { + register59Value = -1; return -1; } else { + register59Value = dataBlock->auxiliaryData[stream][2][23]; // Register 59 return dataBlock->auxiliaryData[stream][2][19]; // chip ID (Register 63) } } diff --git a/Source/Processors/DataThreads/RHD2000Thread.h b/Source/Processors/DataThreads/RHD2000Thread.h index 48f12de158c49f7c9b749d337e9e804615c54cb4..3bc7baca14fa8273ed4b4de9e49d5488f560e5e4 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.h +++ b/Source/Processors/DataThreads/RHD2000Thread.h @@ -173,7 +173,7 @@ private: void updateRegisters(); - int deviceId(Rhd2000DataBlock* dataBlock, int stream); + int deviceId(Rhd2000DataBlock* dataBlock, int stream, int ®ister59Value); bool updateBuffer();