From 05975333c53d58a98b1e91f1edd220d794c7dd46 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 11 Sep 2012 01:01:07 +0100 Subject: Samples: Add fxload sample for Cypress EZ-USB chips * This program was modified from the original fxload at: http://linux-hotplug.sourceforge.net to add libusbx as well as non HEX images support. * Only supports RAM upload for now, with EEPROM and FX3 support to be added at a later stage. --- msvc/ddk_build.cmd | 32 +++++ msvc/fxload.vcxproj | 170 ++++++++++++++++++++++++++ msvc/fxload.vcxproj.filters | 25 ++++ msvc/fxload_sources | 23 ++++ msvc/getopt.vcproj | 288 ++++++++++++++++++++++++++++++++++++++++++++ msvc/getopt.vcxproj | 131 ++++++++++++++++++++ msvc/getopt.vcxproj.filters | 26 ++++ msvc/getopt_sources | 20 +++ msvc/libusb_2010.sln | 23 ++++ 9 files changed, 738 insertions(+) create mode 100644 msvc/fxload.vcxproj create mode 100644 msvc/fxload.vcxproj.filters create mode 100644 msvc/fxload_sources create mode 100644 msvc/getopt.vcproj create mode 100644 msvc/getopt.vcxproj create mode 100644 msvc/getopt.vcxproj.filters create mode 100644 msvc/getopt_sources (limited to 'msvc') diff --git a/msvc/ddk_build.cmd b/msvc/ddk_build.cmd index 714945a..a68b5e2 100644 --- a/msvc/ddk_build.cmd +++ b/msvc/ddk_build.cmd @@ -108,6 +108,38 @@ copy %srcPath%\xusb.pdb %dstPath%\examples @echo off +if exist examples\getopt\getopt_ddkbuild goto md9 +md examples\getopt\getopt_ddkbuild +:md9 + +cd examples\getopt\getopt_ddkbuild +copy ..\..\..\msvc\getopt_sources sources >NUL 2>&1 +@echo on +%BUILD_CMD% +@echo off +if errorlevel 1 goto builderror +cd ..\..\.. + +if exist examples\fxload_ddkbuild goto md8 +md examples\fxload_ddkbuild +:md8 + +cd examples\fxload_ddkbuild +copy ..\..\msvc\fxload_sources sources >NUL 2>&1 +@echo on +%BUILD_CMD% +@echo off +if errorlevel 1 goto builderror +cd ..\.. + +set srcPath=examples\fxload_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir% +@echo on + +copy %srcPath%\fxload.exe %dstPath%\examples +copy %srcPath%\fxload.pdb %dstPath%\examples + +@echo off + cd msvc goto done diff --git a/msvc/fxload.vcxproj b/msvc/fxload.vcxproj new file mode 100644 index 0000000..8c27259 --- /dev/null +++ b/msvc/fxload.vcxproj @@ -0,0 +1,170 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + fxload + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + .;..\examples\getopt;..\libusb;%(AdditionalIncludeDirectories) + WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + {ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e} + + + + + + + + + \ No newline at end of file diff --git a/msvc/fxload.vcxproj.filters b/msvc/fxload.vcxproj.filters new file mode 100644 index 0000000..c274b23 --- /dev/null +++ b/msvc/fxload.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {651ff73d-037b-4903-8dd3-56e9950be25c} + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/msvc/fxload_sources b/msvc/fxload_sources new file mode 100644 index 0000000..d6e31d6 --- /dev/null +++ b/msvc/fxload_sources @@ -0,0 +1,23 @@ +TARGETNAME=fxload +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\msvc;..\..\libusb;..\getopt;$(DDK_INC_PATH) +C_DEFINES=$(C_DEFINES) /D__GNU_LIBRARY__ +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib \ + ..\getopt\getopt_ddkbuild\obj$(BUILD_ALT_DIR)\*\getopt.lib +SOURCES=..\ezusb.c \ + ..\fxload.c diff --git a/msvc/getopt.vcproj b/msvc/getopt.vcproj new file mode 100644 index 0000000..0efcb0b --- /dev/null +++ b/msvc/getopt.vcproj @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/msvc/getopt.vcxproj b/msvc/getopt.vcxproj new file mode 100644 index 0000000..3f413c7 --- /dev/null +++ b/msvc/getopt.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + getopt + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\getopt\ + + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + true + + + + + MaxSpeed + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + X64 + + + HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/msvc/getopt.vcxproj.filters b/msvc/getopt.vcxproj.filters new file mode 100644 index 0000000..d5f4518 --- /dev/null +++ b/msvc/getopt.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/msvc/getopt_sources b/msvc/getopt_sources new file mode 100644 index 0000000..b9adc1b --- /dev/null +++ b/msvc/getopt_sources @@ -0,0 +1,20 @@ +TARGETTYPE=LIBRARY +TARGETNAME=getopt +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +INCLUDES=$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD /DHAVE_STRING_H + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib + +SOURCES=..\getopt1.c \ + ..\getopt.c diff --git a/msvc/libusb_2010.sln b/msvc/libusb_2010.sln index 20bfd32..8bd7e4d 100644 --- a/msvc/libusb_2010.sln +++ b/msvc/libusb_2010.sln @@ -8,6 +8,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs.vcxpro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "xusb.vcxproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fxload", "fxload.vcxproj", "{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}" + ProjectSection(ProjectDependencies) = postProject + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "getopt.vcxproj", "{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -44,6 +51,22 @@ Global {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32 {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64 {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64 + {9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.2.1