comparison sw/mcsi-rxtx/main.c @ 7:8a386263dd51

fc-mcsi-rxtx skeleton put together
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 28 Oct 2024 01:44:28 +0000
parents sw/mcsi-rx/main.c@de85c3680d7e
children
comparison
equal deleted inserted replaced
6:a10657f8024e 7:8a386263dd51
1 /*
2 * Main module for fc-mcsi-rxtx program: interactive, modeled after fc-shell.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8
9 int ttyhacks, dflag;
10
11 main(argc, argv)
12 char **argv;
13 {
14 extern int optind;
15 int c;
16
17 while ((c = getopt(argc, argv, "d")) != EOF) {
18 switch (c) {
19 case 'd':
20 dflag++;
21 continue;
22 default:
23 usage:
24 fprintf(stderr, "usage: %s [-d] ttyport\n", argv[0]);
25 exit(1);
26 }
27 }
28 if (argc != optind + 1)
29 goto usage;
30 open_serial_port(argv[optind]);
31 set_serial_baudrate(187500);
32 init_serial_flush();
33 ttyhacks = isatty(0) && !dflag;
34 tty_init();
35 main_loop(); /* does not return */
36 }