[uClinux-dev] mcfserial wait_until_sent() fix for non-5272

Andrew Kohlsmith akohlsmith-uclinux at benshaw.com
Mon Oct 24 09:15:52 EDT 2005

Here's a small patch that corrects the wait_until_sent() function for non-5272 
processors.  Without this patch it is impossible to know when the last 
character's been transmitted on coldfire processors lacking a FIFO.  This is 
important for shared-bus serial links where the driver must be controlled.

The heart of the patch is just this:
        * For the other coldfire models, spin until the transmitter shift
        * and holding registers are empty.
       while(! (uartp[MCFUART_USR] & MCFUART_USR_TXEMPTY)) {

It's unnecessary to calculate the length of time to wait and try to sleep, 
since there is a maximum of two characters waiting to be sent, and most times 
less than one character.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcfserial.wait_until_sent_fix.diff
Type: text/x-diff
Size: 1498 bytes
Desc: not available
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20051024/84ce2bdf/attachment.bin>

More information about the uClinux-dev mailing list