diff rvinterf/lowlevel/tfc139.c @ 418:a9bf3e92a30c

tfc139: clean exit on success
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 17 Jun 2014 20:59:59 +0000
parents 62f850da5d49
children 3a46728e054b
line wrap: on
line diff
--- a/rvinterf/lowlevel/tfc139.c	Tue Jun 17 07:36:08 2014 +0000
+++ b/rvinterf/lowlevel/tfc139.c	Tue Jun 17 20:59:59 2014 +0000
@@ -52,6 +52,8 @@
 
 static u_char stack_smash_payload[4];
 
+static char *target_tty_port;
+
 static void
 send_compal_memwrite(addr, payload, payload_len)
 	unsigned addr;
@@ -101,6 +103,7 @@
 		goto usage;
 	baudrate_name = "57600";	/* what Compal phones use */
 	open_target_serial(argv[optind]);
+	target_tty_port = argv[optind];
 
 	set_serial_nonblock(0);
 	setlinebuf(stdout);
@@ -154,8 +157,11 @@
 handle_rx_packet()
 {
 	if (rxpkt_len == 2 && rxpkt[0] == 'O' && rxpkt[1] == 'K') {
-		output_line("Success! Run fc-loadtool now!");
-		return;
+		output_line(
+		"Success: target should now be in boot ROM download wait");
+		printf("You can now run fc-loadtool -h compal -c none %s\n",
+			target_tty_port);
+		exit(0);
 	}
 	switch (rxpkt[0]) {
 	case RVT_RV_HEADER: