This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Nonblocking UART driver using _write_r - error if no data was written?


Just a guess - if you want it to be non-blocking, did you open() it with appropriate flag (O_NONBLOCK)? You cannot use fopen() for that - you have to act on fd, as only open() accespts it... Maybe try to reopen your stream with the flag and then use fdopen()?

Another thing - if the driver is non-blocking I think (I'm not sure) that there will be no loop to send everything - the functions you use (printf, flush, ...) would probably set errno to EBUSY (or EAGAIN) and "fail"...

If you have two "threads" anyway (main loop and interrupts) it's very easy to turn that into a simpler case of blocking.

Regards,
FCh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]