This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Nonblocking UART driver using _write_r - error if no data was written?
- From: MikuslawProxy <mikuslawproxy at gmail dot com>
- To: Freddie Chopin <freddie_chopin at op dot pl>
- Cc: newlib at sourceware dot org
- Date: Wed, 26 Feb 2014 20:53:55 +0100
- Subject: Re: Nonblocking UART driver using _write_r - error if no data was written?
- Authentication-results: sourceware.org; auth=none
- References: <CAMym-+z-1ABKQnJaR_eKDTxqk_+0ZgeGdnq_++efJGTBy6o2yA at mail dot gmail dot com> <CAMym-+wVa4HiMNj_LbriWV1WnroxNuNYPnkAe_K24g7EFiMk0Q at mail dot gmail dot com> <530DD434 dot 1 at op dot pl> <CAMym-+yqCAZ3wx8r+3Zijg-DagdzpFbsMs_UJd=UnCYb0USdKw at mail dot gmail dot com> <530E00F7 dot 2050707 at op dot pl>
Hi Corinna, Freedie
I have to say, I have to stop making assumptions without checking
them. Now when I think about it that makes some sense that fflush will
not block with a nonblocking driver.
Freddie, I know - I will have to rethink my driver solution. The
solution with cyclic buffer and interrupt has the advantage of cpu
free operation, but now I think that it will be better to block if
data will not fit in the cyclic buffer. This way I can increase the
size of cyclic buffer and turn off sdio buffering.
Thank you both for help! I got a lot of new ideas and hints how to proceed.
On Wed, Feb 26, 2014 at 3:57 PM, Freddie Chopin <freddie_chopin@op.pl> wrote:
> W dniu 2014-02-26 15:33, MikuslawProxy pisze:
>
>> So, is it a bug that we don't check the write for EAGAIN errno, so we
>> can loop on that in fflush?
>
>
> Take a wider look - you expect your non-blocking driver to block (; Just
> convert your code to be blocking and the problem would be solved.
>
> Regards,
> FCh