Add usage message for UART address in main function
This commit is contained in:
BIN
Binary file not shown.
+11
-3
@@ -6,6 +6,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "users.h"
|
#include "users.h"
|
||||||
#include "tui.h"
|
#include "tui.h"
|
||||||
@@ -19,13 +20,19 @@ void *uartListener(void *arg)
|
|||||||
perror("Failed to open UART");
|
perror("Failed to open UART");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(uart);
|
close(uart);
|
||||||
return NULL;
|
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;
|
int y_max, x_max;
|
||||||
char uart_address[51];
|
char uart_address[51];
|
||||||
pthread_t uart_thread;
|
pthread_t uart_thread;
|
||||||
@@ -51,7 +58,8 @@ int main(int argc, char const *argv[])
|
|||||||
erase();
|
erase();
|
||||||
refresh();
|
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);
|
pthread_create(&uart_thread, NULL, uartListener, uart_address);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user