This commit is contained in:
2018-12-20 17:53:18 +01:00
parent bb10042aae
commit 0c6f849310
4 changed files with 28 additions and 6 deletions

View File

@@ -68,8 +68,6 @@ if (uart0 < 0)
perror("unable to open uart ");
return -1;
}
return uart0; /* WTF ??? */
// CONFIGURE THE UART
// The flags defined in /usr/include/termios.h -
@@ -92,10 +90,10 @@ baudbits = baudrate2const(baudrate);
fprintf(stderr, "%d -> 0x%04x\n", baudrate, baudbits);
#endif
memset(&options, 0, sizeof(options));
memset(&options, 0, sizeof(options));
tcgetattr(uart0, &options);
options.c_cflag = baudbits | CS8 | CLOCAL | CREAD; //<Set baud rate
options.c_cflag = baudbits | CS8 | CLOCAL | CREAD;
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;