Commits

Sven Schnelle  committed 6159796

Change order of EP2 initialization

Seems to make a difference: The old order didn't work sometimes.

Signed-off-by: Sven Schnelle <svens@stackframe.org>

  • Participants
  • Parent commits 6a066c3

Comments (0)

Files changed (2)

File examples/usbmon_c/test.c

 
 	libusb_set_interface_alt_setting(hndl, 0, 0);
 
+for(;;) {
 	for (i = 0; i < (int)sizeof(buf); i++)
 		buf[i] = i;
-for(;;) {
+
 	printf("OUT transfer to device\n");
 	transferred = 0;
-	rv = libusb_bulk_transfer(hndl, 0x02, buf, 64, &transferred, 500);
+	rv = libusb_bulk_transfer(hndl, 0x02, bufl, 32, &transferred, 500);
 	if(rv) {
 		fprintf(stderr, "OUT Transfer failed: %d (%d transferred)\n", rv, transferred);
 //		goto out;
 
 	rv = libusb_bulk_transfer(hndl, 0x02, buf, 0, &transferred, 500);
 	if(rv) {
-		fprintf(stderr, "OUT Transfer failed: %d (%d transferred)\n", rv, transferred);
+		fprintf(stderr, "OUT0 Transfer failed: %d (%d transferred)\n", rv, transferred);
 //		goto out;
 	}
 

File examples/usbmon_c/usbmon.c

 	ENABLE_USBRESET();
 
 	CPUCS = 0x12;
-	REVCTL |= bmBIT0 | bmBIT1;
+	REVCTL = bmBIT0 | bmBIT1;
 
 	IFCONFIG = 0xe3;
 	SYNCDELAY();
 	FIFORESET = 0x80;
 	SYNCDELAY();
 
+	FIFORESET = 0x02;
+	SYNCDELAY();
+
+	FIFORESET = 0x04;
+	SYNCDELAY();
+
 	FIFORESET = 0x06;
 	SYNCDELAY();
 
+	FIFORESET = 0x08;
+	SYNCDELAY();
+
 	FIFORESET = 0x00;
 	SYNCDELAY();
 
+	OUTPKTEND = 0x82;
+	SYNCDELAY();
+	OUTPKTEND = 0x82;
+	SYNCDELAY();
+	OUTPKTEND = 0x82;
+	SYNCDELAY();
+	OUTPKTEND = 0x82;
+	SYNCDELAY();
+
+
 	EP2FIFOCFG = 0;
 	SYNCDELAY();
 
 	EP6AUTOINLENL = 0x00;
 	SYNCDELAY();
 
-	OUTPKTEND = 0x82;
-	SYNCDELAY();
-	OUTPKTEND = 0x82;
-	SYNCDELAY();
-	OUTPKTEND = 0x82;
-	SYNCDELAY();
-	OUTPKTEND = 0x82;
-	SYNCDELAY();
-
 }
 
 void main()