# HG changeset patch # User Christian Taedcke # Date 1320740849 0 # Node ID a3ff0e3e9829eaa7866d5353fc507e21a8320b38 # Parent dce1e0af66047b4028ca7a4e24260c1035ae7cef Win32 IXXAT driver: FIXED: - A return value of 0 from VCI_ResetCan() and VCI_StartCan() indicates an error, too. CHANGED: - The return values of VCI_ResetCan() and VCI_StartCan() are logged in case of an error. diff -r dce1e0af6604 -r a3ff0e3e9829 drivers/can_ixxat_win32/ixxat.cpp --- a/drivers/can_ixxat_win32/ixxat.cpp Thu Dec 22 16:03:39 2011 +0100 +++ b/drivers/can_ixxat_win32/ixxat.cpp Tue Nov 08 08:27:29 2011 +0000 @@ -338,14 +338,20 @@ ::OutputDebugString("\nIXXAT canBusWatchdog: Remote queue overrun detected!\n"); } - if (VCI_ResetCan(m_BoardHdl, CAN_NUM) < 0) - { - ::OutputDebugString("\nIXXAT canBusWatchdog: ERROR: Resetting the can module failed!\n"); + res = VCI_ResetCan(m_BoardHdl, CAN_NUM); + if (res <= 0) + { + char buf[200]; + ::sprintf(buf, "\nIXXAT canBusWatchdog: ERROR: Resetting the can module failed with code '%d'!\n", res); + ::OutputDebugString(buf); } - if (VCI_StartCan(m_BoardHdl, CAN_NUM) < 0) - { - ::OutputDebugString("\nIXXAT canBusWatchdog: ERROR: Restaring the can module failed!\n"); + res = VCI_StartCan(m_BoardHdl, CAN_NUM); + if (res <= 0) + { + char buf[200]; + ::sprintf(buf, "\nIXXAT canBusWatchdog: ERROR: Restaring the can module failed with code '%d'!\n", res); + ::OutputDebugString(buf); } } }