changeset 689:730a9f919dcd

fc-loadtool flash erase-program-boot fix to not stop scripts
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 11 Mar 2020 00:48:15 +0000
parents 6345326e21aa
children 0100861ec867
files loadtools/flcmplboot.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/flcmplboot.c	Wed Mar 11 00:31:30 2020 +0000
+++ b/loadtools/flcmplboot.c	Wed Mar 11 00:48:15 2020 +0000
@@ -116,6 +116,17 @@
 	*s = '\0';
 }
 
+static
+op_status_filter(line)
+	char *line;
+{
+	puts(line);
+	if (strcmp(line, "Operation complete, final SR: 80"))
+		return(1);
+	else
+		return(0);
+}
+
 flashcmd_erase_program_boot(argc, argv)
 	char **argv;
 {
@@ -254,5 +265,5 @@
 	tpinterf_make_cmd(targv);
 	if (tpinterf_send_cmd() < 0)
 		return(-1);
-	return tpinterf_pass_output(20);	/* 20 s timeout */
+	return tpinterf_capture_output(20, op_status_filter);
 }