summaryrefslogtreecommitdiffstats
path: root/serial_keypad.c
diff options
context:
space:
mode:
authorroot <root@nolonger-other.tetra.james.local>2020-10-27 10:57:41 +0000
committerroot <root@nolonger-other.tetra.james.local>2020-10-27 10:57:41 +0000
commit232cf21c35c79458969fd661d18ca779c5418c2e (patch)
treeda96dac46f43583047f5d0501675a21325c93587 /serial_keypad.c
parent59415c62777983cbc8a1096266149fb8f18e94a9 (diff)
downloadgalaxy_tools-232cf21c35c79458969fd661d18ca779c5418c2e.tar.gz
galaxy_tools-232cf21c35c79458969fd661d18ca779c5418c2e.tar.bz2
galaxy_tools-232cf21c35c79458969fd661d18ca779c5418c2e.zip
statics
Diffstat (limited to 'serial_keypad.c')
-rw-r--r--serial_keypad.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/serial_keypad.c b/serial_keypad.c
index 91939e6..6c92e1b 100644
--- a/serial_keypad.c
+++ b/serial_keypad.c
@@ -14,7 +14,7 @@
static int usage (const char *name)
{
fprintf (stderr, "Usage:\n");
- fprintf (stderr, "%s -p device [ -b baud ]\n", name);
+ fprintf (stderr, "%s -p device [ -b baud ] [ -d debug ] [ -l log_file ]\n", name);
fprintf (stderr, "\n");
return -1;
@@ -25,10 +25,12 @@ int main (int argc, char *argv[])
{
unsigned opt;
const char *port = NULL;
+ const char *log = NULL;
+ int debug = 0;
unsigned baud = 9600;
int fd;
- while ((opt = getopt (argc, argv, "h:p:z:USPRBFTAD")) != -1) {
+ while ((opt = getopt (argc, argv, "h:p:z:dl:")) != -1) {
switch (opt) {
case 'p':
port = optarg;
@@ -38,6 +40,14 @@ int main (int argc, char *argv[])
baud = atoi (optarg);
break;
+ case 'd':
+ debug++;
+ break;
+
+ case 'l':
+ log = optarg;
+ break;
+
default: /* '?' */
return usage (argv[0]);
}
@@ -56,7 +66,7 @@ int main (int argc, char *argv[])
}
- return gd_keypad (fd);
+ return gd_keypad (fd, log, debug);
}