MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / set_stty

Function set_stty

bsp/simulator/drivers/uart_console.c:98–107  ·  view source on GitHub ↗

simulate windows' getch(), it works!!*/

Source from the content-addressed store, hash-verified

96static struct termios oldt, newt;
97/*simulate windows' getch(), it works!!*/
98static void set_stty(void)
99{
100 /* get terminal input's attribute */
101 tcgetattr(STDIN_FILENO, &oldt);
102 newt = oldt;
103
104 /* set termios' local mode */
105 newt.c_lflag &= ~(ECHO|ICANON);
106 tcsetattr(STDIN_FILENO, TCSANOW, &newt);
107}
108
109void restore_stty(void)
110{

Callers 1

ThreadforKeyGetFunction · 0.85

Calls 2

tcgetattrFunction · 0.85
tcsetattrFunction · 0.85

Tested by

no test coverage detected