FreeCalypso > hg > fc-pcm-if
view sw/mcsi-rxtx/main.c @ 15:8b49ea8aeb99
fc-mcsi-rxtx: more reliable fflush(stdout) in main loop
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 28 Oct 2024 23:43:10 +0000 |
parents | 8a386263dd51 |
children |
line wrap: on
line source
/* * Main module for fc-mcsi-rxtx program: interactive, modeled after fc-shell. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> int ttyhacks, dflag; main(argc, argv) char **argv; { extern int optind; int c; while ((c = getopt(argc, argv, "d")) != EOF) { switch (c) { case 'd': dflag++; continue; default: usage: fprintf(stderr, "usage: %s [-d] ttyport\n", argv[0]); exit(1); } } if (argc != optind + 1) goto usage; open_serial_port(argv[optind]); set_serial_baudrate(187500); init_serial_flush(); ttyhacks = isatty(0) && !dflag; tty_init(); main_loop(); /* does not return */ }