Hi Grr,
Could you please test your driver with the following application:
/
* hello_main
/
int main(int argc, FAR char *argv[])
{
char name[
On Thu, Jan 28, 2021 at 3:16 AM Grr wrote:
> I opted for The Right Thing(TM) and implemented a simple serial input echo
> capabilities for serial driver introducing use of ECHO flag in
> drivers/serial/serial.c and proper configuration options in menuconfig
>
> Now the interface of an interactive
I opted for The Right Thing(TM) and implemented a simple serial input echo
capabilities for serial driver introducing use of ECHO flag in
drivers/serial/serial.c and proper configuration options in menuconfig
Now the interface of an interactive serial program works the same in Linux
and NuttX :)
Ken:
Thanks a lot for your code. I will try it
I was researching that echo thing and yes, that's a terminal device driver
thing. More exactly, c_lflag of termios struct. Problem is I haven't found
yet where that is set in the serial terminal setup sequence
El mar, 26 ene 2021 a las 11:28, Johnny
On 2021-01-26 16:16, Ken Pettit wrote:
Grr,
Yeah, in Nuttx, fgets, fgetc, etc. don't echo. Even in Linux, the echo
is actually a function of the terminal, not the running program and
'fgets'.
It is actually not a function of the terminal, but the terminal (serial)
device driver.
Johnny
Grr,
Slightly revised version to remove trailing '\n', just for completenes. :)
my_get_command(struct spitest_s *spitest)
{
charinput[80];
ssize_t len = 0;
while (len == 0)
{
printf("\nEnter Command:");
fflush(stdout);
len = readline(input,
fferent calling
parameters (you also have to ensure it is enabled / configured in 'make
menuconfig':
#include
my_get_command(struct spitest_s *spitest)
{
charinput[80];
ssize_t len = 0;
while (len == 0)
{
printf("\nEnter Command:");
fflush(stdout);
Hello
That fflush is for fgets
Yes, with a stdout flush, message prints but the question remains about why
is it needed and how can I get input echo
Thanks
Grr
El lun, 25 ene 2021 a las 13:30, Ken Pettit () escribió:
> Hey Grr,
>
> You need the fflush(stdout) call to be *after* t
Hey Grr,
You need the fflush(stdout) call to be *after* the printf("\nEnter
Command:").
If the printf doesn't end with \n, then the stdout won't be flushed.
Ken
On 1/25/21 11:25 AM, Grr wrote:
Hello to all
Is there a way to get stdout without a LF?
I have something
Hello to all
Is there a way to get stdout without a LF?
I have something like
case INPUT_CMD:
fflush(stdin);
printf("\nEnter Command:");
fgets(input, INPUT_STRING, stdin);
spitest.cmd = input[0]; /* First char is the command */
that in Linux prints message
10 matches
Mail list logo