I received from motorola the following answer:
"This customer use Linux and have trouble to send 0x0A or 0x0D, this
to his Linux I/O driver. Metrowerks CodeWarrior for HC08 is run under
Windowes OS and it
works fine on 908JB8 without any trouble on send 0x0A or 0x0D down."
can someone untar http://demaine.free.fr/monitor_68hc08/src/ read the
file rs232.c and try to find whats wrong between lines 49 to 71 ?
I really dont understand what could make opening the port in a wrong
You dont really need to comile ... just read my last post, my logbook
p29 and my source file.
Thanks for any help
"Doublehp" <d...@doublehp.org> wrote in message
after 2h of chat on IRC, someone said me that i forgot to enter
nonOPOST mode, so I added line 70 with the proper line as described on
/* canonical raw input */
vars->serial->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
vars->serial->c_lflag &= ~OPOST;
vars->serial->c_cflag |= (CS8); /* use 8bit data */
// term_prop->c_cflag |= (CLOCAL | CREAD);
tcsetattr(fd, TCSAFLUSH, vars->serial);
but I still had the same bug ... so that people offered that very
sprintf(stty,"stty -a < %s",vars->device);
Q: why isnt the line with ~OPOST enough ???
> vars->serial->c_lflag &= ~OPOST;
> but I still had the same bug ... so that people offered that very
> horrible hack:
> I put
> sprintf(stty,"stty -a < %s",vars->device);
> after tcsetattr
> Q: why isnt the line with ~OPOST enough ???
OPOST needs to be applied to c_oflag (output modes), not c_lflag
You are right. Thank you all of you for your help
Actually, this is setting *non*canonical input (turning off ICANON).
"Canonical" input means translating the terminal's idea of CR into
Unix's idea (0x0A). By default, the serial port is configured to
talk to a terminal, so flags like that are turned on.
See "man termios" for all the gory details. Yo ucan probably get what
you want with "raw" mode: call tcgetattr(), cfmakeraw(), and then
tcsetattr() to apply the modified attributes back onto the serial device.
cfmakeraw() does almost the same thing you're doing in the code snippet
you posted, except it modifies a few more flags.
Wim Lewis <wi...@hhhh.org>, Seattle, WA, USA. PGP keyID 27F772C1