Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: LPC2106 newlib-lpc read() problems.

2006-03-08 by ourslandj

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@...> wrote:
>
> Quoting ourslandj <xmm0@...>:
> > Well, I built a toolchain for Linux, downloaded and installed newlib
> > and newlib-lpc.  To get it all working I created a file sys_isatty.c
> > which defines int isatty(int i) { return 1 }.  Then I got uart0_int
> > working properly for writing and made it asynchronous to speed things
> > up a bit.
> >
> > But, heres the problem: I cannot use write() or read() directly on
> > either com1 or com1_int.  When I do a write(stdout, "HI!",
> > sizeof("HI!"));  it locks up on me completely.
> 
> Are you making the ioctl calls to set up the interrupts?
> 
> Robert
>

Thanks for the rapid response!!!

Yessir.

I turned on -Wall (I thought I already had!) well, it pointed out that
I was making a pointer to an int by using write(stdout.....) instead
of write(fileno(stdout)... 

So, that pretty much solved that problem.  Boy, do I feel like an idiot.

Anyhow, I encountered a race condition with test10.c if I make the
output more than the size of the send_buffer (32).  Do you also get
that?  I made a solution and if you'd like I'd be more than happy to
contribute!

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.