From 4ff9a7f03de7bb6955e8519460d0ec99e4cb574b Mon Sep 17 00:00:00 2001 From: Eduard Dlabal Date: Sun, 20 Apr 2025 21:02:49 +0200 Subject: [PATCH] Add usage message for UART address in main function --- output/main | Bin 22920 -> 22920 bytes src/main.c | 14 +++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/output/main b/output/main index 0d57115e99cca4542984e868bc3bed421b8e8b1e..ba0bc0ef600acae1d8e5db7ebcb16856b5d67106 100755 GIT binary patch delta 42 zcmV+_0M-A9vjK>+0kEJ06fiEEBS%kB8jzDNa>q^a2TY^pPP4QF@IC=jv!z1g7GuE? AZ2$lO delta 42 zcmV+_0M-A9vjK>+0kEJ06w;LMwdJo>D)Cgml_TY2l%RQ9=CiZ|@IC=@v!z1g7SL1` Ai~s-t 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);