changeset 382:a2210b0361c1

loadtools: implemented compal-stage setting in hw parameter files
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 09 Jun 2014 21:53:12 +0000
parents 837ba1b47478
children 326363ba5bf4
files loadtools/hwparam.c
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/hwparam.c	Mon Jun 09 21:31:47 2014 +0000
+++ b/loadtools/hwparam.c	Mon Jun 09 21:53:12 2014 +0000
@@ -18,6 +18,28 @@
 char hw_init_script[128];
 
 static void
+handle_compal_stage(arg, filename_for_errs, lineno_for_errs)
+	char *arg;
+	char *filename_for_errs;
+	int lineno_for_errs;
+{
+	char *cp;
+
+	while (isspace(*arg))
+		arg++;
+	if (!*arg) {
+		fprintf(stderr,
+		"%s line %d: compal-stage setting requires an argument\n",
+			filename_for_errs, lineno_for_errs);
+		exit(1);
+	}
+	for (cp = arg; *cp && !isspace(*cp); cp++)
+		;
+	*cp = '\0';
+	set_compalstage_short(arg);
+}
+
+static void
 handle_init_script(arg, filename_for_errs, lineno_for_errs)
 	char *arg;
 	char *filename_for_errs;
@@ -107,6 +129,7 @@
 	char *name;
 	void (*func)();
 } cmdtab[] = {
+	{"compal-stage", handle_compal_stage},
 	{"exit-mode", set_default_exit_mode},
 	{"flash", set_flash_device},
 	{"init-script", handle_init_script},