On 11-Jan-07, at 13:20 , Andrew Lunn wrote:

Up until this particular issue I have had no problems using "standard in". I will look to see what effect opening /dev/termios0, but most examples
I have seen use STDIN_FILENO directly.

Please could you point me at the eCos examples that do this?

Changing my code slightly, I now find that I now block at cin.get().
I wondering whether I am doing something wrong when changing to canocial
mode?

char InputHandler::DoPressAnyKey()
{
    struct termios  ts, ots;
    int             c  = 0;
    int             fd = STDIN_FILENO;

    cout << "--0\n";

    tcflush(fd,TCIOFLUSH);

    cout << "--1\n";

You are using stdout, not the file descriptor for a /dev/termios0.  I
would first determine is you are using the correct file
descriptor. When this really is wrong, nothing will work......

            Andrew


I changed the code to read:

   int             fd = open ( "/dev/termios0", O_RDONLY) ;

in all instances, but that seems to make no difference at all. I can get
input and modify termio settings, as in the previous case, but when I
hit multiple enters (or any key for that matter) before I get to the code,
the select() or cin.get() don't come back.

BTW It should be noted that Termios TTY channel #0, in my ecos config file,
points to /dev/ser0

Andre


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply via email to