changeset 418:a9bf3e92a30c

tfc139: clean exit on success
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 17 Jun 2014 20:59:59 +0000
parents d8a120647649
children 3a46728e054b
files rvinterf/lowlevel/tfc139.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
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: