You don't have to wait for empty TXB but for empty TSR (Transmitting Shift
Register).
This should do the job:
while(1) // wait for empty TSR
{
if(ioctl(fd,TIOCSERGETLSR,&aLSR)=-1) { // get the Line Status Register
fprintf(stderr," (GETLSR ERROR!)");
break;
}
if(aLSR&&0x40) break; // TSR is empty
usleep(3000UL); // sleep for 3 ms (1/BAUDRATE*3)
}
You should optimize the loop.
Hope that helps,
Michael
Michael Harig . o O (Verr�ckte Welt)
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to [EMAIL PROTECTED]