changeset 78:702c2c40e51a

fc-simtool update-rec-prev command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 17 Feb 2021 05:07:54 +0000
parents 4558048fce10
children b0982c0cf54d
files simtool/dispatch.c simtool/writecmd.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/dispatch.c	Wed Feb 17 01:17:00 2021 +0000
+++ b/simtool/dispatch.c	Wed Feb 17 05:07:54 2021 +0000
@@ -62,6 +62,7 @@
 extern int cmd_update_bin();
 extern int cmd_update_bin_imm();
 extern int cmd_update_rec();
+extern int cmd_update_rec_prev();
 extern int cmd_user_sum();
 extern int cmd_verify_chv();
 extern int cmd_verify_ext();
@@ -153,6 +154,7 @@
 	{"update-bin", 2, 2, cmd_update_bin},
 	{"update-bin-imm", 2, 2, cmd_update_bin_imm},
 	{"update-rec", 2, 2, cmd_update_rec},
+	{"update-rec-prev", 1, 1, cmd_update_rec_prev},
 	{"user-sum", 0, 0, cmd_user_sum},
 	{"verify-chv1", 1, 1, cmd_verify_chv},
 	{"verify-chv2", 1, 1, cmd_verify_chv},
--- a/simtool/writecmd.c	Wed Feb 17 01:17:00 2021 +0000
+++ b/simtool/writecmd.c	Wed Feb 17 05:07:54 2021 +0000
@@ -63,3 +63,19 @@
 	}
 	return update_rec_op(recno, 0x04, data, curfile_record_len);
 }
+
+cmd_update_rec_prev(argc, argv)
+	char **argv;
+{
+	u_char data[255];
+	int rc;
+
+	rc = read_hex_data_file(argv[1], data);
+	if (rc < 0)
+		return(rc);
+	if (rc != curfile_record_len) {
+		fprintf(stderr, "error: hex data length != EF record length\n");
+		return(-1);
+	}
+	return update_rec_op(0, 0x03, data, curfile_record_len);
+}