uart dialog
This commit is contained in:
+15
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user