[En-Nut-Discussion] USART RINGBUF Structure Change

Matthias Ringwald mringwal at inf.ethz.ch
Mon Nov 8 20:10:02 CET 2004


On 08.11.2004, at 19:33, Harald Kipp wrote:

> Some members of the RINGBUF structure are modified
> in interrupt context but were not marked volatile.

> I changed this in CVS HEAD. No idea if this may have
> caused any problems in the past,
we might do have uart-related problems, but we couldn't
nail them down so far. we'll see, if they go away
with your fix, which would be very cool btw.

> but the driver passed
> a long time test with this modification here.

did you see my other posting on usartavr?


one more comment on usartavr.c:

the AvrUsartDisable function does a busy wait to assure
that the last byte written to TX buffer is out of the ATmel.
This obviously only works correctly, if the time for
one byte (including start/stop/parity) is shorter then
the waiting time. with the used 10 ms, this matches
a 9600 baud rate. if the baud rate is lower, during
changing baud rate, the last byte might get corrupted.

the correct way here is to check the tx complete bit of
the usart. (which I guess, I'm welcomed to implement but
is not high on my priority list).. I just wanted to point
this potential bug out... :)


> Harald
>
> P.S. Matthias, I'm sorry for having spoiled the
> old-style CTS definition in a previous change.
no problem, you actually only could to be sorry for not
mentioning the changes a bit mor.
fixing them in our sources wasn't a problem at all.
also the idea with having ALL config data in
include/cfg/arch.h is better than having the cfg/*.h files.


regards,
Matthias




More information about the En-Nut-Discussion mailing list