Add usage message for UART address in main function

This commit is contained in:
2025-04-20 21:02:49 +02:00
parent f44bd795d5
commit 4ff9a7f03d
2 changed files with 11 additions and 3 deletions
BIN
View File
Binary file not shown.
+10 -2
View File
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <string.h>
#include "users.h"
#include "tui.h"
@@ -24,8 +25,14 @@ void *uartListener(void *arg)
return NULL;
}
int main(int argc, char const *argv[])
int main(int argc, char const **argv)
{
if (argc != 1)
{
printf("Usage: %s <Address of RFID reader>\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);