(This page was last updated on Thursday, October 15, 1998)
Important!!!!!
A small bug in the library was discovered by Elias Gil in my sendByte function. If you try to send more than one byte of data at the same time, data loss could happen. To fix the problem replace the sendByte function (in rs232.c) with the code below.
//////////////////////////////////////////////////////////////
//
//
//
//////////////////////////////////////////////////////////////
void sendByte(char *port, byte databyte)
{
//if the global uart is the same port ... (this will be
// for opening more than 1 port in future releases)
if( strncmp(port, (*globalUart).port, strlen(port)))
{
//wait until transmitting holding register empty.
// We can do nothing while waiting so NULL.
// was 0x04 (bit 2) which should have been !0x20 (bit 5)
// this was suggested by Elias Gil on 16 Aug 98
//***********************************
//Elias Gil
//Zapex Research (Israel) Ltd
//Tel: (972) 9 8658624
//Fax: (972) 9 8851112
//e-mail:
[email protected]
//***********************************
while( !(0x20 & INPORT((*globalUart).portid+LSR)) )
NULL;
//send the byte ...
OUTPORT((*globalUart).portid+TX, databyte);
}
else
{
printf("ERROR: %s: line %i:", __FILE__, __LINE__);
printf("ports must be equal\n");
exit(EXIT_FAILURE);
}
}