r4701 - trunk/src/host/dfu-util/src

laforge at docs.openmoko.org laforge at docs.openmoko.org
Tue Oct 7 19:42:36 CEST 2008


Author: laforge
Date: 2008-10-07 19:42:36 +0200 (Tue, 07 Oct 2008)
New Revision: 4701

Modified:
   trunk/src/host/dfu-util/src/sam7dfu.c
Log:
* add hashmark printing during DFU upload
* add copyright notice to code copied from sam7dfu project (OpenPCD)


Modified: trunk/src/host/dfu-util/src/sam7dfu.c
===================================================================
--- trunk/src/host/dfu-util/src/sam7dfu.c	2008-10-07 17:37:05 UTC (rev 4700)
+++ trunk/src/host/dfu-util/src/sam7dfu.c	2008-10-07 17:42:36 UTC (rev 4701)
@@ -1,5 +1,7 @@
 /* This is supposed to be a "real" DFU implementation, just as specified in the
  * USB DFU 1.0 Spec.  Not overloaded like the Atmel one...
+ *
+ * (C) 2007-2008 by Harald Welte <laforge at gnumonks.org>
  */
 
 #include <stdio.h>
@@ -36,6 +38,10 @@
 		goto out_free;
 	}
 	
+	printf("bytes_per_hash=%u\n", xfer_size);
+	printf("Starting upload: [");
+	fflush(stdout);
+
 	while (1) {
 		int rc, write_rc;
 		rc = dfu_upload(usb_handle, interface, xfer_size, buf);
@@ -45,7 +51,7 @@
 		}
 		write_rc = write(fd, buf, rc);
 		if (write_rc < rc) {
-			fprintf(stderr, "Short write: %s\n",
+			fprintf(stderr, "Short file write: %s\n",
 				strerror(errno));
 			ret = total_bytes;
 			goto out_close;
@@ -56,9 +62,14 @@
 			ret = total_bytes;
 			goto out_close;
 		}
+		putchar('#');
+		fflush(stdout);
 	}
 	ret = 0;
 
+	printf("] finished!\n");
+	fflush(stdout);
+
 out_close:
 	close(fd);
 out_free:




More information about the commitlog mailing list