[En-Nut-Discussion] Proposal: Extending the USART(AVR) driver to support DMA-style read functionality

Matthias Ringwald mringwal at inf.ethz.ch
Fri Apr 16 16:51:18 CEST 2004


Hi Harald,

third answer/mail from me...

>> a/my solution:
>>
>> I would like to add an ioctl call that changes the semantic
>> of read from
>> [current]: at least one byte is read or timeout occured to
>> [new:] all bytes are read or timeout occured.
>> (if timeout occured, the return value [nr of read bytes]
>> would be lower then the count value)
>
> Many RS232 drivers support two timeouts, the one for the
> first character, which may be long or infinite. And a second
> timeout after the first byte had been received. This would
> also solve situations, where you do not know the length
> of the telegram in advance.

ok. never seen this. thanks for mentioning.
for me, it doesn't help.

> [...]
>> the benefit of this is:
>> reducing the number of read calls reduces the nr of thread
>> switches, which leads to savings in processing power depending
>> on the cpu load and the packet size.
>
> Agreed.

This means, you understand the idea.
Does this means, "go ahead and change the cvs"
or only, "yeah. nice. interesting." ?

I'm happy with the changes to
usartavr.c, uart.h, usart.h (clean and straight forward)
the addition to usart.c doesn't look so nice, as the
code for block read  differs quite much from the normal
one. i could just put it into another function and call it
if block mode is enabled.

matthias




More information about the En-Nut-Discussion mailing list