diff loadtools/compalram.c @ 945:86ff6d0b0a97

loadtools: fc-compalram trivial utility added
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 02 Nov 2015 17:36:02 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadtools/compalram.c	Mon Nov 02 17:36:02 2015 +0000
@@ -0,0 +1,26 @@
+/*
+ * This module contains the main() function for fc-compalram, a trivial
+ * utility that feeds a binary download image to Compal's bootloader
+ * and then switches into serial tty pass-through.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+extern char *target_ttydev;
+
+main(argc, argv)
+	char **argv;
+{
+	if (argc != 3) {
+		fprintf(stderr, "usage: fc-compalram ttyport image.bin\n");
+		exit(1);
+	}
+	target_ttydev = argv[1];
+	set_compalstage_fullpath(argv[2]);
+
+	open_target_serial();
+	perform_compal_stage(0);
+	tty_passthru();
+	exit(0);
+}