--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.travis.yml Wed Jun 13 19:08:58 2012 +0200
@@ -0,0 +1,27 @@
+language: "c"
+install: "echo"
+
+before_script:
+ - sudo apt-get install libxenomai-dev
+# - sudo apt-get install gcc-avr binutils-avr avr-libc
+
+script: "./configure --can=\"$CAN_DRIVER\" --timers=\"$TIMERS\" && make"
+branches:
+ only:
+ - master
+notifications:
+ recipients:
+ - hacking@taedcke.com
+ email:
+ on_success: change
+ on_failure: always
+ irc: "irc.freenode.org#canfestival"
+
+env:
+ - CAN_DRIVER="virtual" TIMERS="unix"
+ - CAN_DRIVER="vscom" TIMERS="unix"
+ - CAN_DRIVER="can4linux" TIMERS="unix"
+ - CAN_DRIVER="lincan" TIMERS="unix"
+ - CAN_DRIVER="socket" TIMERS="unix"
+ - CAN_DRIVER="virtual" TIMERS="xeno"
+ - CAN_DRIVER="socket" TIMERS="xeno"
--- a/CanFestival-3.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/CanFestival-3.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -54,7 +54,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
- <ProgramDataBaseFileName>$(IntDir)CanFestival-3.pdb</ProgramDataBaseFileName>
+ <ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
--- a/configure Wed Jun 13 19:07:41 2012 +0200
+++ b/configure Wed Jun 13 19:08:58 2012 +0200
@@ -88,7 +88,7 @@
rm -f $test $test.c
if [ "$XENO_CONFIG" = "" ]; then
- XENO_CONFIG=/usr/xenomai/bin/xeno-config
+ XENO_CONFIG=xeno-config
fi
if [ "$RTAI_CONFIG" = "" ]; then
@@ -482,9 +482,8 @@
fi
if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then
- RT_LIB_DIR=`$XENO_CONFIG --library-dir`\ -Wl,-rpath\ `$XENO_CONFIG --library-dir`
- SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ `$XENO_CONFIG --xeno-ldflags`\ -L$RT_LIB_DIR\ -lnative\ -lrtdm
- SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DUSE_XENO\ `$XENO_CONFIG --xeno-cflags`
+ SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ `$XENO_CONFIG --skin=native --ldflags`\ -lrtdm
+ SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DUSE_XENO\ `$XENO_CONFIG --skin=rtdm --cflags`
RTCAN_SOCKET=1
fi
--- a/drivers/can_anagate_win32/can_anagate_win32.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_anagate_win32/can_anagate_win32.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -24,7 +24,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
+ <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
--- a/drivers/can_copcican_win32/can_copcican_win32.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_copcican_win32/can_copcican_win32.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -20,7 +20,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
+ <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
--- a/drivers/can_ixxat_win32/can_ixxat_win32.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_ixxat_win32/can_ixxat_win32.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -57,6 +57,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<AdditionalDependencies>vci11un6.lib;%(AdditionalDependencies)</AdditionalDependencies>
--- a/drivers/can_ixxat_win32/ixxat.cpp Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_ixxat_win32/ixxat.cpp Wed Jun 13 19:08:58 2012 +0200
@@ -69,6 +69,8 @@
~IXXAT();
bool send(const Message *m);
bool receive(Message *m);
+
+ static bool isDriverClosed() {return m_driverClosed;}
private:
bool open(int board_number, const char* baud_rate);
bool close();
@@ -86,6 +88,8 @@
UINT16 m_RxQueHdl;
async_access_que<VCI_CAN_OBJ> m_RX_Que;
static IXXAT* m_callbackPtr;
+
+ static bool m_driverClosed;
static UINT_PTR m_watchdogTimerId;
static const unsigned int CAN_BUS_WATCHDOG_INTERVAL_MSEC = 10000;
@@ -103,6 +107,8 @@
UINT_PTR IXXAT::m_watchdogTimerId = 0;
+bool IXXAT::m_driverClosed = false;
+
IXXAT::IXXAT(s_BOARD *board) : m_BoardHdl(0xFFFF),
m_TxQueHdl(0xFFFF),
m_RxQueHdl(0xFFFF)
@@ -244,11 +250,14 @@
//Start CAN Bus-Off watchdog
m_watchdogTimerId = SetTimer(NULL, NULL, IXXAT::CAN_BUS_WATCHDOG_INTERVAL_MSEC, IXXAT::canBusWatchdog);
+ m_driverClosed = false;
+
return true;
}
bool IXXAT::close()
{
+ m_driverClosed = true;
if (m_BoardHdl == 0xFFFF)
return true;
VCI_ResetBoard(m_BoardHdl);
@@ -369,12 +378,14 @@
extern "C"
UNS8 __stdcall canReceive_driver(CAN_HANDLE inst, Message *m)
{
+ if (IXXAT::isDriverClosed()) return 0;
return reinterpret_cast<IXXAT*>(inst)->receive(m) ? 0 : 1;
}
extern "C"
UNS8 __stdcall canSend_driver(CAN_HANDLE inst, Message const *m)
{
+ if (IXXAT::isDriverClosed()) return 0;
return reinterpret_cast<IXXAT*>(inst)->send(m) ? 0 : 1;
}
--- a/drivers/can_ixxat_win32/ixxat.def Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_ixxat_win32/ixxat.def Wed Jun 13 19:08:58 2012 +0200
@@ -26,3 +26,4 @@
canSend_driver
canOpen_driver
canClose_driver
+ canChangeBaudRate_driver
--- a/drivers/can_peak_win32/can_peak_win32.c Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.c Wed Jun 13 19:08:58 2012 +0200
@@ -261,7 +261,7 @@
m->rtr = 1;
m->len = peakMsg.LEN; /* count of data bytes (0..8) */
for (data = 0; data < peakMsg.LEN; data++)
- m->Data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */
+ m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */
#if defined DEBUG_MSG_CONSOLE_ON
MSG("in : ");
print_message(m);
@@ -301,7 +301,7 @@
peakMsg.LEN = m->len;
/* count of data bytes (0..8) */
for (data = 0; data < m->len; data++)
- peakMsg.DATA[data] = m->Data[data]; /* data bytes, up to 8 */
+ peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */
do
{
--- a/drivers/can_peak_win32/can_peak_win32.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -78,7 +78,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../include;../../include/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../../include/win32;D:\myProjects/PCAN-Light API/Include/C++;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -99,11 +99,12 @@
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)can_peak_win32.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>D:\myProjects\PCAN-Light API\Win32\VC_LIB\PCAN_USB.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <AdditionalIncludeDirectories>../../include;../../include/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../../include/win32;D:\myProjects/PCAN-Light API/Include/C++;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
@@ -123,11 +124,12 @@
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)can_peak_win32.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>D:\myProjects\PCAN-Light API\Win32\VC_LIB\PCAN_USB.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release UNICODE|Win32'">
<ClCompile>
- <AdditionalIncludeDirectories>../../include;../../include/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../../include/win32;D:\myProjects/PCAN-Light API/Include/C++;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
@@ -147,12 +149,13 @@
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)can_peak_win32.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>D:\myProjects\PCAN-Light API\Win32\VC_LIB\PCAN_USB.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug UNICODE|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../include;../../include/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../../include/win32;D:\myProjects/PCAN-Light API/Include/C++;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -173,6 +176,7 @@
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)can_peak_win32.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>D:\myProjects\PCAN-Light API\Win32\VC_LIB\PCAN_USB.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -184,10 +188,6 @@
<ItemGroup>
<ClInclude Include="cancfg.h" />
</ItemGroup>
- <ItemGroup>
- <Library Include="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_2pcc.lib" />
- <Library Include="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_pcc.lib" />
- </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
--- a/drivers/can_peak_win32/can_peak_win32.vc10.vcxproj.filters Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.vc10.vcxproj.filters Wed Jun 13 19:08:58 2012 +0200
@@ -29,8 +29,4 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
- <ItemGroup>
- <Library Include="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_2pcc.lib" />
- <Library Include="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_pcc.lib" />
- </ItemGroup>
</Project>
\ No newline at end of file
--- a/drivers/can_peak_win32/can_peak_win32.vc9.vcproj Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.vc9.vcproj Wed Jun 13 19:08:58 2012 +0200
@@ -4,6 +4,7 @@
Version="9,00"
Name="can_peak_win32"
ProjectGUID="{732EC5B6-C6F1-4783-9BC8-924FFF67BF5A}"
+ RootNamespace="can_peak_win32"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
@@ -41,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../../include;../../include/win32"
+ AdditionalIncludeDirectories="../../include;../../include/win32;"D:\myProjects\PCAN-Light API\Include\C++""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -62,6 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="D:/myProjects/PCAN-Light API/Win32/PCAN_USB.dll"
OutputFile="$(OutDir)/can_peak_win32.dll"
LinkIncremental="2"
ModuleDefinitionFile="can_peak_win32.def"
@@ -121,7 +123,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include;../../include/win32"
+ AdditionalIncludeDirectories="../../include;../../include/win32;"D:\myProjects\PCAN-Light API\Include\C++""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -140,6 +142,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="D:/myProjects/PCAN-Light API/Win32/PCAN_USB.dll"
OutputFile="$(OutDir)/can_peak_win32.dll"
LinkIncremental="1"
ModuleDefinitionFile="can_peak_win32.def"
@@ -200,7 +203,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include;../../include/win32"
+ AdditionalIncludeDirectories="../../include;../../include/win32;"D:\myProjects\PCAN-Light API\Include\C++""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -219,6 +222,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="D:/myProjects/PCAN-Light API/Win32/PCAN_USB.dll"
OutputFile="$(OutDir)/can_peak_win32.dll"
LinkIncremental="1"
ModuleDefinitionFile="can_peak_win32.def"
@@ -280,7 +284,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../../include;../../include/win32"
+ AdditionalIncludeDirectories="../../include;../../include/win32;"D:\myProjects\PCAN-Light API\Include\C++""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CANpeak_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -301,6 +305,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="D:/myProjects/PCAN-Light API/Win32/PCAN_USB.dll"
OutputFile="$(OutDir)/can_peak_win32.dll"
LinkIncremental="2"
ModuleDefinitionFile="can_peak_win32.def"
@@ -369,14 +374,6 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
- <File
- RelativePath="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_2pcc.lib"
- >
- </File>
- <File
- RelativePath="..\..\..\..\PC-Card\Lib\Visual C++\Pcan_pcc.lib"
- >
- </File>
</Files>
<Globals>
</Globals>
--- a/drivers/win32/win32.c Wed Jun 13 19:07:41 2012 +0200
+++ b/drivers/win32/win32.c Wed Jun 13 19:08:58 2012 +0200
@@ -97,7 +97,7 @@
* @param driver_name String containing driver's dynamic library name
* @return Library handle
*/
-LIB_HANDLE LoadCanDriver(LPCTSTR driver_name)
+LIB_HANDLE LoadCanDriver(LPCSTR driver_name)
{
// driver module handle
LIB_HANDLE handle = NULL;
@@ -105,7 +105,7 @@
#ifndef NOT_USE_DYNAMIC_LOADING
if(handle == NULL)
{
- handle = LoadLibrary(driver_name);
+ handle = LoadLibraryA(driver_name);
}
if (!handle)
--- a/examples/CANOpenShell/CANOpenShell.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/examples/CANOpenShell/CANOpenShell.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -24,7 +24,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
+ <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -57,9 +57,10 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
- <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
--- a/examples/win32test/main.c Wed Jun 13 19:07:41 2012 +0200
+++ b/examples/win32test/main.c Wed Jun 13 19:08:58 2012 +0200
@@ -107,7 +107,7 @@
/* process command line arguments */
if (argc < 2)
{
- printf("USAGE: win32test <node_id> [can driver dll filename [baud rate]]\n");
+ printf("USAGE: win32test <node_id> [can driver dll filename [baud rate[bus name]]]\n");
return 1;
}
@@ -126,6 +126,9 @@
if (argc > 3)
MasterBoard.baudrate = argv[3];
+ if (argc > 4)
+ MasterBoard.busname = argv[4];
+
// load can driver
if (!LoadCanDriver(dll_file_name))
{
@@ -158,12 +161,13 @@
/* modify Client SDO 1 Parameter */
UNS32 COB_ID_Client_to_Server_Transmit_SDO = 0x600 + node_id;
UNS32 COB_ID_Server_to_Client_Receive_SDO = 0x580 + node_id;
- UNS32 Node_ID_of_the_SDO_Server = node_id;
- UNS32 ExpectedSize = sizeof (UNS32);
+ UNS8 Node_ID_of_the_SDO_Server = node_id;
+ UNS32 ExpectedSize = sizeof(UNS32);
+ UNS32 ExpectedSizeNodeId = sizeof (UNS8);
if (OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 1, &COB_ID_Client_to_Server_Transmit_SDO, &ExpectedSize, RW)
&& OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 2, &COB_ID_Server_to_Client_Receive_SDO, &ExpectedSize, RW)
- && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 3, &Node_ID_of_the_SDO_Server, &ExpectedSize, RW))
+ && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 3, &Node_ID_of_the_SDO_Server, &ExpectedSizeNodeId, RW))
{
UNS32 dev_type = 0;
char device_name[64]="";
--- a/examples/win32test/win32test.vc10.vcxproj Wed Jun 13 19:07:41 2012 +0200
+++ b/examples/win32test/win32test.vc10.vcxproj Wed Jun 13 19:08:58 2012 +0200
@@ -18,7 +18,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
@@ -57,6 +57,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<OutputFile>$(OutDir)win32test.exe</OutputFile>
--- a/include/can_driver.h Wed Jun 13 19:07:41 2012 +0200
+++ b/include/can_driver.h Wed Jun 13 19:08:58 2012 +0200
@@ -49,11 +49,14 @@
#if !defined(WIN32) || defined(__CYGWIN__)
#define DLL_CALL(funcname) funcname##_driver
#else
+#define LIBAPI __stdcall
//Windows was missing the definition of the calling convention
-#define DLL_CALL(funcname) __stdcall funcname##_driver
+#define DLL_CALL(funcname) LIBAPI funcname##_driver
#endif
#endif //DLL_CALL
+#define LIBPUBLIC
+
#ifndef FCT_PTR_INIT
#define FCT_PTR_INIT
#endif
--- a/include/win32/applicfg.h Wed Jun 13 19:07:41 2012 +0200
+++ b/include/win32/applicfg.h Wed Jun 13 19:08:58 2012 +0200
@@ -101,9 +101,9 @@
//Visual Studio 2005 and above
#ifdef UNICODE
#define MSG(...) \
- do{wchar_t msg[300];\
- swprintf(msg,sizeof(msg)/sizeof(msg[0]), L##__VA_ARGS__); \
- OutputDebugString(msg);}while(0)
+ do{char msg[300];\
+ sprintf(msg, __VA_ARGS__); \
+ OutputDebugStringA(msg);}while(0)
#else
#define MSG(...) \
do{char msg[300];\
@@ -126,7 +126,7 @@
#define CANFESTIVAL_DEBUG_MSG(num, str, val)\
{unsigned long value = val;\
- MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \
+ MSG("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value); \
}
#define CANFESTIVAL_DEBUG_DRV_MSG(...)\
--- a/include/win32/canfestival.h Wed Jun 13 19:07:41 2012 +0200
+++ b/include/win32/canfestival.h Wed Jun 13 19:08:58 2012 +0200
@@ -32,7 +32,7 @@
typedef HINSTANCE LIB_HANDLE;
UNS8 UnLoadCanDriver(LIB_HANDLE handle);
-LIB_HANDLE LoadCanDriver(LPCTSTR driver_name);
+LIB_HANDLE LoadCanDriver(LPCSTR driver_name);
UNS8 canSend(CAN_PORT port, Message *m);
CAN_PORT canOpen(s_BOARD *board, CO_Data * d);
int canClose(CO_Data * d);