diff --git a/output/main b/output/main index 0d57115..ba0bc0e 100755 Binary files a/output/main and b/output/main differ diff --git a/src/main.c b/src/main.c index 93995ed..2e778ed 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "users.h" #include "tui.h" @@ -19,13 +20,19 @@ void *uartListener(void *arg) perror("Failed to open UART"); return NULL; } - + close(uart); return NULL; } -int main(int argc, char const *argv[]) +int main(int argc, char const **argv) { + if (argc != 1) + { + printf("Usage: %s
\n", argv[0]); + return EXIT_FAILURE; + } + int y_max, x_max; char uart_address[51]; pthread_t uart_thread; @@ -51,7 +58,8 @@ int main(int argc, char const *argv[]) erase(); refresh(); - uartDialog(uart_address, x_max, y_max); + // uartDialog(uart_address, x_max, y_max); + strcpy(uart_address, argv[1]); pthread_create(&uart_thread, NULL, uartListener, uart_address);