Enhance UART handling and improve TUI input management

This commit is contained in:
2025-04-06 17:56:32 +02:00
parent 248af2bc4d
commit f44bd795d5
4 changed files with 66 additions and 41 deletions
+13 -2
View File
@@ -12,7 +12,15 @@
void *uartListener(void *arg)
{
char *uart_address = (char *)arg;
int uart = open(uart_address, O_RDWR | O_NOCTTY | O_NDELAY);
if (uart == -1)
{
perror("Failed to open UART");
return NULL;
}
close(uart);
return NULL;
}
@@ -27,12 +35,15 @@ int main(int argc, char const *argv[])
getmaxyx(stdscr, y_max, x_max);
if (x_max <= MIN_X_TERMINAL_SIZE || y_max <= MIN_Y_TERMINAL_SIZE)
{
endwin();
clear();
puts("Terminal is too small. Exiting...\n");
return EXIT_FAILURE;
}
noecho();
noraw();
cbreak();
start_color();
curs_set(0);
@@ -42,7 +53,7 @@ int main(int argc, char const *argv[])
uartDialog(uart_address, x_max, y_max);
pthread_create(&uart_thread, NULL, uartListener, NULL);
pthread_create(&uart_thread, NULL, uartListener, uart_address);
//