diff sw/mcsi-rx/main.c @ 3:de85c3680d7e

sw: fc-mcsi-rx program put together
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 11 Oct 2024 23:54:39 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sw/mcsi-rx/main.c	Fri Oct 11 23:54:39 2024 +0000
@@ -0,0 +1,26 @@
+/*
+ * Main module for fc-mcsi-rx program.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+FILE *out_binfile;
+
+main(argc, argv)
+	char **argv;
+{
+	if (argc != 3) {
+		fprintf(stderr, "usage: %s ttyport out-bin-file\n", argv[0]);
+		exit(1);
+	}
+	open_serial_port(argv[1]);
+	set_serial_baudrate(187500);
+	init_serial_flush();
+	out_binfile = fopen(argv[2], "w");
+	if (!out_binfile) {
+		perror(argv[2]);
+		exit(1);
+	}
+	main_loop();		/* does not return */
+}