drivers/can_peak_win32/can_peak_win32.c
changeset 650 58b07a7e695b
parent 633 2c43383a1d57
child 696 381af6bb6155
equal deleted inserted replaced
649:3beb784bacee 650:58b07a7e695b
   148 			//wait for CAN msg...
   148 			//wait for CAN msg...
   149 			result = WaitForSingleObject(hEvent2, INFINITE);
   149 			result = WaitForSingleObject(hEvent2, INFINITE);
   150 			if (result == WAIT_OBJECT_0)
   150 			if (result == WAIT_OBJECT_0)
   151 				Res = CAN2_ReadEx(&peakMsg, &peakRcvTime);
   151 				Res = CAN2_ReadEx(&peakMsg, &peakRcvTime);
   152 				// Exit receive thread when handle is no more valid
   152 				// Exit receive thread when handle is no more valid
   153 				if(Res & CAN_ERRMASK_ILLHANDLE)
   153 				if(Res & CAN_ERR_ILLHANDLE)
   154 					return 1;
   154 					return 1;
   155 		}
   155 		}
   156 		else
   156 		else
   157 #endif
   157 #endif
   158 
   158 
   161 			result = WaitForSingleObject(hEvent1, INFINITE);
   161 			result = WaitForSingleObject(hEvent1, INFINITE);
   162 			if (result == WAIT_OBJECT_0)
   162 			if (result == WAIT_OBJECT_0)
   163 			{
   163 			{
   164 				Res = CAN_ReadEx(&peakMsg, &peakRcvTime);
   164 				Res = CAN_ReadEx(&peakMsg, &peakRcvTime);
   165 				// Exit receive thread when handle is no more valid
   165 				// Exit receive thread when handle is no more valid
   166 				if(Res & CAN_ERRMASK_ILLHANDLE)
   166 				if(Res & CAN_ERR_ILLHANDLE)
   167 					return 1;
   167 					return 1;
   168 			}
   168 			}
   169 		}
   169 		}
   170 		else
   170 		else
   171 			Res = CAN_ERR_BUSOFF;
   171 			Res = CAN_ERR_BUSOFF;