uart dialog

This commit is contained in:
2025-04-02 19:07:38 +02:00
parent 816815ff84
commit 334bda6a91
4 changed files with 56 additions and 1 deletions
+15
View File
@@ -3,8 +3,14 @@
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include "users.h"
#include "tui.h"
void *uartListener(void *arg)
{
@@ -15,11 +21,17 @@ void *uartListener(void *arg)
int main(int argc, char const *argv[])
{
int y_max, x_max;
char * uart_address;
pthread_t uart_thread;
initscr();
getmaxyx(stdscr, y_max, x_max);
if (x_max <= MIN_X_TERMINAL_SIZE || y_max <= MIN_Y_TERMINAL_SIZE)
{
puts("Terminal is too small. Exiting...\n");
return EXIT_FAILURE;
}
noecho();
noraw();
@@ -30,9 +42,12 @@ int main(int argc, char const *argv[])
erase();
refresh();
uartDialog(x_max, y_max);
pthread_create(&uart_thread, NULL, uartListener, NULL);
//
getch();
pthread_join(uart_thread, NULL);