Beispiel #1
0
BOOL _SerialReadByte(unsigned char* Dest, DWORD timeout_us)
{
	int bytesReady = 0;
	DWORD tim1 = TickGet();
	
	do
	{
		if( ((TickGet() - tim1) * 16) > timeout_us)		
			return FALSE;		
			
		bytesReady = RS485BufferSize(Port_);			
	}while(bytesReady < 1);

	RS485Read(Port_, (char *)Dest, 1);	
	return TRUE;
}
Beispiel #2
0
int RS485Read()
{
    return RS485Read(10, 10);
}