r4637 - developers/werner/dbgrst

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Sep 9 00:40:17 CEST 2008


Author: werner
Date: 2008-09-09 00:40:16 +0200 (Tue, 09 Sep 2008)
New Revision: 4637

Modified:
   developers/werner/dbgrst/Makefile
   developers/werner/dbgrst/dbgrst.c
Log:
- dbgrst.c (set_high): repeat the command several times since it sometimes gets
  lost
- Makefile: make "install" depend on "dbgrst"



Modified: developers/werner/dbgrst/Makefile
===================================================================
--- developers/werner/dbgrst/Makefile	2008-09-08 11:18:24 UTC (rev 4636)
+++ developers/werner/dbgrst/Makefile	2008-09-08 22:40:16 UTC (rev 4637)
@@ -7,7 +7,7 @@
 
 all:		dbgrst
 
-install:
+install:	dbgrst
 		install -D dbgrst $(PREFIX)/bin/dbgrst
 
 uninstall:

Modified: developers/werner/dbgrst/dbgrst.c
===================================================================
--- developers/werner/dbgrst/dbgrst.c	2008-09-08 11:18:24 UTC (rev 4636)
+++ developers/werner/dbgrst/dbgrst.c	2008-09-08 22:40:16 UTC (rev 4637)
@@ -79,12 +79,19 @@
 		data,
 		direction,
 	};
+	int i;
 
-	if (ftdi_write_data(&ftdi, buf, 3) < 0) {
-		fprintf(stderr, "ftdi_write_data: %s\n",
-		    ftdi_get_error_string(&ftdi));
-		exit(1);
-	}
+	/*
+	 * For some reason, the FTDI sometimes doesn't accept the setting.
+	 * So we repeat a number of times to make it clear that compliance
+	 * is not optional.
+	 */
+	for (i = 0; i != 10; i++)
+		if (ftdi_write_data(&ftdi, buf, 3) < 0) {
+			fprintf(stderr, "ftdi_write_data: %s\n",
+			    ftdi_get_error_string(&ftdi));
+			exit(1);
+		}
 }
 
 




More information about the commitlog mailing list