Browse Source

was cfmakeraw the good fix ?

phyto 6 months ago
parent
commit
7a3ba3b44c
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      serial/serial.c

+ 4
- 2
serial/serial.c View File

@@ -95,12 +95,14 @@ memset(&options, 0, sizeof(options));
95 95
 tcgetattr(uart0, &options);
96 96
 options.c_cflag = baudbits | CS8 | CLOCAL | CREAD;
97 97
 options.c_iflag = IGNPAR;
98
-options.c_oflag = 0;
98
+options.c_oflag = IGNPAR;
99 99
 options.c_lflag = 0;
100 100
 
101
+cfmakeraw(&options);			/* XXX */
102
+
101 103
 options.c_cc[VMIN] = 1;			/* ask for blocking read */
102 104
 
103
-tcflush(uart0, TCIFLUSH);
105
+tcflush(uart0, TCIOFLUSH);
104 106
 tcsetattr(uart0, TCSANOW, &options);
105 107
 
106 108
 tcflush(uart0, TCIFLUSH);		/* do it again, sam */

Loading…
Cancel
Save