bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: ncurses, pthreads, and serial port


From: Troy Davis
Subject: RE: ncurses, pthreads, and serial port
Date: Thu, 30 May 2002 16:57:41 -0500

Okay-
        I now have gotten rid of threading all together.  I am now using select 
to
block in my keyboard handler, and then differentiating between keystrokes
and serial input.  The results are strange.  In the serial input window
(which shows the characters read in from the serial port) it will print out
characters until it reaches the right edge of the window, and then that line
of text disappears, and the next line begins printing text.  The text on the
line on which serial input ceases remains.  Is there something about wprintw
and window edges I am missing?  I am also seeing corruption of the text
printed to screen which is also odd - I have checked and rechecked and
checked again my buffers, pointers, etc. and seen nothing wrong with them.
The text are valid characters, but it appears 4 or 5 letters are switched
around here and there and random.
        Has anyone indicated that there is a problem with the serial port
programming in linux and ncurses?  I got rid of the previously mentioned
screen corruption with my menu window by making the int serial_port_handle
global instead of local.  Is it safe to attach code to mails to the list?

Troy Davis
Airborne Data Systems, Inc.

> -----Original Message-----
> From: address@hidden [mailto:address@hidden
> Behalf Of Thomas Dickey
> Sent: Thursday, May 30, 2002 2:17 PM
> To: Troy Davis
> Cc: address@hidden
> Subject: Re: ncurses, pthreads, and serial port
>
>
> On Thu, May 30, 2002 at 10:14:28AM -0500, Troy Davis wrote:
> > Ah-
> >     That answers that question.  Now I have a new problem.  When I call
> > open("/dev/ttys0", O_RDWR | O_NOCTTY | O_NONBLOCK) I get screen
> corruption -
> > my left menu is partially overwritten by what I use as a
> background color
> > (blue), and the scroll functions no longer work.  I have
> tracked it down to
> > this specific call that does it.  Of course, I was doing this call in a
> > thread before which did not result in screen corruption but
> resulted in odd
> > behavior of the serial output window.  Any ideas anyone?
>
> not really.  does strace work on threaded code?  if so, perhaps it could
> should the output which is corrupting the window (admittedly with
> some work).
>
> --
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net
>
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]