mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-23 01:53:23 +00:00
Got CMake Running On Windows
This commit is contained in:
parent
6d89435157
commit
ec18c797b9
15
.gitignore
vendored
15
.gitignore
vendored
@ -14,4 +14,17 @@ Software/waveview/package-lock.json
|
||||
Software/waveview/package-lock.json
|
||||
Software/waveview/package.json
|
||||
Software/xdma_driver_win_src_2018_2/*
|
||||
*.exe
|
||||
Software/waveview/.vs/*
|
||||
Software/waveview/CMakeFiles/*
|
||||
Software/waveview/scope.dir/Debug/*
|
||||
Software/waveview/Debug/*
|
||||
*.exe
|
||||
Software/waveview/scope.vcxproj.user
|
||||
Software/waveview/scope.vcxproj.filters
|
||||
Software/waveview/x86/*
|
||||
Software/waveview/x64/*
|
||||
Software/waveview/ZERO_CHECK/*
|
||||
Software/waveview/ZERO_CHECK.vcxproj.filters
|
||||
Software/waveview/ALL_BUILD.vcxproj.filters
|
||||
Software/waveview/cmake_install.cmake
|
||||
Software/waveview/CMakeCache.txt
|
||||
|
181
Software/waveview/ALL_BUILD.vcxproj
Normal file
181
Software/waveview/ALL_BUILD.vcxproj
Normal file
File diff suppressed because one or more lines are too long
171
Software/waveview/ZERO_CHECK.vcxproj
Normal file
171
Software/waveview/ZERO_CHECK.vcxproj
Normal file
File diff suppressed because one or more lines are too long
53
Software/waveview/scope.sln
Normal file
53
Software/waveview/scope.sln
Normal file
@ -0,0 +1,53 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{0BA98A3C-B548-389E-A02A-6E48C1E25BF8}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7084C576-F300-3059-B643-CEA43018FC08} = {7084C576-F300-3059-B643-CEA43018FC08}
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD} = {2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{7084C576-F300-3059-B643-CEA43018FC08}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scope", "scope.vcxproj", "{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7084C576-F300-3059-B643-CEA43018FC08} = {7084C576-F300-3059-B643-CEA43018FC08}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
MinSizeRel|x64 = MinSizeRel|x64
|
||||
RelWithDebInfo|x64 = RelWithDebInfo|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0BA98A3C-B548-389E-A02A-6E48C1E25BF8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0BA98A3C-B548-389E-A02A-6E48C1E25BF8}.Release|x64.ActiveCfg = Release|x64
|
||||
{0BA98A3C-B548-389E-A02A-6E48C1E25BF8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
|
||||
{0BA98A3C-B548-389E-A02A-6E48C1E25BF8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.Debug|x64.Build.0 = Debug|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.Release|x64.ActiveCfg = Release|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.Release|x64.Build.0 = Release|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{7084C576-F300-3059-B643-CEA43018FC08}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.Debug|x64.Build.0 = Debug|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.Release|x64.ActiveCfg = Release|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.Release|x64.Build.0 = Release|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{2EABCB61-15AB-39F3-B09F-7CB45A2D8EFD}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7760AEC1-8DCA-34BC-92D7-DC62F5AAA76A}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
341
Software/waveview/scope.vcxproj
Normal file
341
Software/waveview/scope.vcxproj
Normal file
File diff suppressed because one or more lines are too long
@ -14,112 +14,5 @@
|
||||
* FT_HANDLE *device_handle - A pointer to a variable which will hold the inialized handle to the FIFO SuperSpeed Bridge
|
||||
*/
|
||||
void InitFTDISuperSpeedChip(FT_HANDLE *deviceHandle) {
|
||||
|
||||
DWORD numDevices;
|
||||
DWORD error;
|
||||
DWORD driverVersion;
|
||||
DWORD libraryVersion;
|
||||
long chipIdx = -1;
|
||||
|
||||
//Get library version
|
||||
FT_GetLibraryVersion(&libraryVersion);
|
||||
INFO << "Library Version is: " << libraryVersion;
|
||||
|
||||
//check the driver for a super speed FIFO buffer, if it exists, open it and set its configuration.
|
||||
error = FT_CreateDeviceInfoList(&numDevices);
|
||||
if(FT_OK != error) {
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_CreateDeviceList()");
|
||||
}
|
||||
|
||||
if( numDevices == 0 ) {
|
||||
error = EVErrorCodeInvalidValue;
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip. No devices found");
|
||||
} else {
|
||||
INFO << "Devices found: " << numDevices;
|
||||
}
|
||||
|
||||
FT_DEVICE_LIST_INFO_NODE* deviceInfoList = (FT_DEVICE_LIST_INFO_NODE*)malloc(sizeof(FT_DEVICE_LIST_INFO_NODE) * numDevices);
|
||||
|
||||
error = FT_GetDeviceInfoList(deviceInfoList, &numDevices);
|
||||
if(FT_OK != error) {
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_GetDeviceInfoList()");
|
||||
}
|
||||
|
||||
//Find the index of the EVScope USB Transfer Chip base on the device description
|
||||
for(unsigned int i = 0; i < numDevices; i++) {
|
||||
INFO << "Device description: " << std::string(deviceInfoList[i].Description);
|
||||
|
||||
if(std::string(deviceInfoList[i].Description) == std::string(FT601_CHIP_DESC)) {
|
||||
chipIdx = i;
|
||||
std::cout << "Found Chip at idx: " << i << std::endl;
|
||||
std::cout << "Chip Description: " << deviceInfoList[i].Description << std::endl;
|
||||
}
|
||||
}
|
||||
//if no scope USB transfer chip was found
|
||||
if(chipIdx == -1) {
|
||||
throw EVException(error,"EVSuperSpeedFIFOBridge:InitFTDISuperSpeedChip:Find_Chip_Idx");
|
||||
}
|
||||
|
||||
/* God I hate this shitty driver
|
||||
if(FT_OK != (error = FT_Create( (PVOID)chipIdx, (DWORD)FT_OPEN_BY_INDEX, deviceHandle))){
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_Create");
|
||||
}
|
||||
*/
|
||||
|
||||
if(FT_OK != (error = FT_Create((PVOID)"EVScope USB Transfer Chip", (DWORD)FT_OPEN_BY_DESCRIPTION, deviceHandle))){
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_Create");
|
||||
}
|
||||
|
||||
//Get Drvier Version for the FTDI chip
|
||||
FT_GetDriverVersion(*deviceHandle,&driverVersion);
|
||||
INFO << "Driver Version for FT601 is: " << driverVersion;
|
||||
|
||||
//Set Channel Config to fifo600_mode and 100Mhz clk with appropiate flags
|
||||
FT_60XCONFIGURATION oldConfig, newConfig;
|
||||
if(FT_OK != (error = FT_GetChipConfiguration(*deviceHandle, &oldConfig))) {
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_GetChipConfiguration");
|
||||
}
|
||||
memcpy(&newConfig, &oldConfig, sizeof(FT_60XCONFIGURATION));
|
||||
newConfig.FIFOClock = CONFIGURATION_FIFO_CLK_100;
|
||||
newConfig.FIFOMode = CONFIGURATION_FIFO_MODE_245;
|
||||
newConfig.OptionalFeatureSupport |= CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCHALL | CONFIGURATION_OPTIONAL_FEATURE_DISABLECANCELSESSIONUNDERRUN | CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCHALL;
|
||||
newConfig.ChannelConfig = CONFIGURATION_CHANNEL_CONFIG_1_INPIPE;
|
||||
if(FT_OK != (error = FT_SetChipConfiguration(*deviceHandle, &newConfig))) {
|
||||
throw new EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_SetChipConfiguration");
|
||||
}
|
||||
FT_Close(*deviceHandle);
|
||||
|
||||
//Wait For The SuperSpeed FIFO Bridge To Power Cycle
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
||||
//reopen device since configuration causes a reset
|
||||
*deviceHandle = 0;
|
||||
if(FT_OK != (error = FT_CreateDeviceInfoList(&numDevices))) {
|
||||
throw new EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_CreateDeviceInfoList");
|
||||
}
|
||||
|
||||
if( numDevices == 0 ) {
|
||||
error = EVErrorCodeInvalidValue;
|
||||
throw new EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip");
|
||||
}
|
||||
|
||||
if(FT_OK != (error = FT_GetDeviceInfoList(deviceInfoList, &numDevices))) {
|
||||
throw new EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_GetDeviceInfoList on reconnect");
|
||||
}
|
||||
|
||||
chipIdx = -1;
|
||||
//Find the index of the EVScope USB Transfer Chip
|
||||
for(unsigned int i = 0; i < numDevices; i++) {
|
||||
if(std::string(deviceInfoList[i].Description) == std::string(FT601_CHIP_DESC)) {
|
||||
chipIdx = i;
|
||||
}
|
||||
}
|
||||
//if no scope USB transfer chip was found
|
||||
if(chipIdx == -1) {
|
||||
throw EVException(error,"EVSuperSpeedFIFOBridge:InitFTDISuperSpeedChip:Find_Chip_Idx on reconnect");
|
||||
}
|
||||
|
||||
if(FT_OK != (error = FT_Create( (PVOID)chipIdx, (DWORD)FT_OPEN_BY_INDEX, deviceHandle))){
|
||||
throw EVException(error,"EVSuperSpeedFIFOBRidge:InitFTDISuperSpeedChip:FT_Create on reconnect");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -126,6 +126,7 @@ Bridge::~Bridge() {
|
||||
* Return:
|
||||
* None
|
||||
******************************************************************************/
|
||||
#ifndef WIN32
|
||||
int Bridge::makeConnection(int targetSocket ) {
|
||||
int targetFD = 0;
|
||||
|
||||
@ -162,6 +163,7 @@ int Bridge::makeConnection(int targetSocket ) {
|
||||
}
|
||||
return targetFD;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* TxJob()
|
||||
|
@ -78,13 +78,6 @@ void DataTransferHandler::FTDITransferThread()
|
||||
|
||||
asyncDataBuffers[0] = bufferAllocator.allocate(1);
|
||||
bufferAllocator.construct(asyncDataBuffers[0]);
|
||||
|
||||
errorCode = FT_ReadPipe(superSpeedFIFOBridgeHandle,
|
||||
FTDI_FLAG_READ_CHIP_TO_COMPUTER,
|
||||
(unsigned char*)asyncDataBuffers[0]->data,
|
||||
BUFFER_SIZE,
|
||||
(PULONG)&bytesReadFromPipe,
|
||||
nullptr);
|
||||
|
||||
assert(bytesReadFromPipe == BUFFER_SIZE);
|
||||
assert(errorCode == 0);
|
||||
@ -273,7 +266,6 @@ DataTransferHandler::~DataTransferHandler()
|
||||
|
||||
if(superSpeedFIFOBridgeHandle != 0)
|
||||
{
|
||||
FT_Close(superSpeedFIFOBridgeHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user