UsartRead and timeout

Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org> Mon, 24 Apr 2023 19:28:59 +0200
Newsgroups gmane.comp.hardware.microcontrollers.ethernut
Message-ID <[email protected]>
Hello,

../../dev/usart.c in UsartRead reads:
    228     /*
    229      * Wait until at least one character is buffered or until a read
    230      * timeout occured.
    231      */

Is this really the intended behaviour? I would expect to read like

* Wait until the requested number of character is buffered or until a read
* timeout occured.

This would be in line with e.g.
https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/setting-read-and-write-timeouts-for-a-serial-device"
"Serial.sys continues to transfer bytes until the requested number of
bytes are transferred or a time-out event occurs."

Returning after the first received byte makes it hard to wait for the
full multi-byte answer of an external device.

What is your opinion?

Thanks
-- 
Uwe Bonnes                bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion