--- a/drivers/can_peak_win32/can_peak_win32.c Wed Sep 30 12:01:25 2009 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.c Mon Oct 05 11:35:40 2009 +0200
@@ -217,6 +217,7 @@
UNS8 canSend_driver (CAN_HANDLE fd0, Message * m)
{
UNS8 data;
+ DWORD localerrno;
TPCANMsg peakMsg;
peakMsg.ID = m->cob_id; /* 11/29 bit code */
if (m->rtr == 0)
@@ -236,19 +237,19 @@
// if not the first handler
if(second_board == (s_BOARD *)fd0)
{
- errno = CAN2_Write (&peakMsg);
+ errno = localerrno = CAN2_Write (&peakMsg);
}
else
#endif
if(first_board == (s_BOARD *)fd0)
{
- errno = CAN_Write (&peakMsg);
+ errno = localerrno = CAN_Write (&peakMsg);
}
else
goto fail;
- if (errno)
- {
- if (errno == CAN_ERR_BUSOFF)
+ if (localerrno)
+ {
+ if (localerrno == CAN_ERR_BUSOFF)
{
printf ("!!! Peak board write : re-init\n");
canInit((s_BOARD*)fd0);
@@ -257,7 +258,7 @@
usleep (1000);
}
}
- while (errno != CAN_ERR_OK);
+ while (localerrno != CAN_ERR_OK);
#if defined DEBUG_MSG_CONSOLE_ON
MSG("out : ");
print_message(m);
--- a/examples/CANOpenShell/CANOpenShell.vcproj Wed Sep 30 12:01:25 2009 +0200
+++ b/examples/CANOpenShell/CANOpenShell.vcproj Mon Oct 05 11:35:40 2009 +0200
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include;..\..\include\win32"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -61,7 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies=""..\..\lib\static\libcanfestival.lib" "..\..\lib\static\libcanfestival_win32.lib" "..\..\lib\static\libgcc.lib""
+ AdditionalDependencies=""..\..\lib\static\libcanfestival.lib" "..\..\lib\static\libcanfestival_win32.lib""
LinkIncremental="2"
GenerateDebugInformation="false"
SubSystem="1"