Use spaces instead of tabs in serial.c

main
Ry 2023-04-01 19:09:36 -07:00
parent d559f63c85
commit 08e7168b1d
1 changed files with 11 additions and 11 deletions

View File

@ -9,24 +9,24 @@ static struct termios saved_tios;
static bool is_terminal = false;
static void exit_handler(void) {
if (is_terminal)
tcsetattr(0, TCSANOW, &saved_tios);
if (is_terminal)
tcsetattr(0, TCSANOW, &saved_tios);
}
void serial_init(void) {
struct termios tios;
struct termios tios;
if (tcgetattr(0, &tios) != -1) {
is_terminal = 1;
saved_tios = tios;
if (tcgetattr(0, &tios) != -1) {
is_terminal = 1;
saved_tios = tios;
atexit(exit_handler);
}
}
if (is_terminal) {
tios.c_lflag &= ~(ICANON|ECHO);
tcsetattr(0, TCSANOW, &tios);
}
if (is_terminal) {
tios.c_lflag &= ~(ICANON|ECHO);
tcsetattr(0, TCSANOW, &tios);
}
}
int serial_get(void) {