[dahdi-commits] tzafrir: branch tools/2.5 r10354 - /tools/branches/2.5/xpp/astribank_hexload.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed Nov 30 04:23:47 CST 2011


Author: tzafrir
Date: Wed Nov 30 04:23:44 2011
New Revision: 10354

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10354
Log:
xpp: astribank_hexload: we need more lines

* Newer firmwares may have more lines.
* While we're at it, add better debug printing.
* Remove some unused debugging code.

Modified:
    tools/branches/2.5/xpp/astribank_hexload.c

Modified: tools/branches/2.5/xpp/astribank_hexload.c
URL: http://svnview.digium.com/svn/dahdi/tools/branches/2.5/xpp/astribank_hexload.c?view=diff&rev=10354&r1=10353&r2=10354
==============================================================================
--- tools/branches/2.5/xpp/astribank_hexload.c (original)
+++ tools/branches/2.5/xpp/astribank_hexload.c Wed Nov 30 04:23:44 2011
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <errno.h>
 #include <assert.h>
 #include <arpa/inet.h>
@@ -36,7 +37,7 @@
 #include "../autoconfig.h"
 
 #define	DBG_MASK	0x80
-#define	MAX_HEX_LINES	10000
+#define	MAX_HEX_LINES	64000
 #define HAVE_OCTASIC	1
 
 static char	*progname;
@@ -81,15 +82,27 @@
 	return 0;
 }
 
+void print_parse_errors(int level, const char *msg, ...)
+{
+	va_list ap;
+
+	if (verbose > level) {
+		va_start (ap, msg);
+		vfprintf (stderr, msg, ap);
+		va_end (ap);
+	}
+}
+
 static int load_hexfile(struct astribank_device *astribank, const char *hexfile, enum dev_dest dest)
 {
 	struct hexdata		*hexdata = NULL;
 	int			finished = 0;
 	int			ret;
-	int			i;
+	unsigned		i;
 	char			star[] = "+\\+|+/+-";
 	const char		*devstr;
 
+	parse_hexfile_set_reporting(print_parse_errors);
 	if((hexdata  = parse_hexfile(hexfile, MAX_HEX_LINES)) == NULL) {
 		perror(hexfile);
 		return -errno;
@@ -100,13 +113,6 @@
 		xusb_serial(astribank->xusb),
 		dev_dest2str(dest),
 		hexdata->fname, hexdata->version_info);
-#if 0
-	FILE		*fp;
-	if((fp = fopen("fpga_dump_new.txt", "w")) == NULL) {
-		perror("dump");
-		exit(1);
-	}
-#endif
 	if((ret = mpp_send_start(astribank, dest, hexdata->version_info)) < 0) {
 		ERR("%s: Failed hexfile send start: %d\n", devstr, ret);
 		return ret;




More information about the dahdi-commits mailing list