Commits

Kyösti Mälkki committed 0735126

Fix index for data endpoints

With added CDC descriptor, data endpoints moved to interface 1.
Fix firmware to reset data toggle on set_interface and change
test utility to claim correct interface.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>

  • Participants
  • Parent commits 01ab42b

Comments (0)

Files changed (2)

File examples/debugdevice_full_duplex/debugdev.c

 
 BOOL handle_set_interface(BYTE ifc, BYTE alt_ifc)
 {
-	if (ifc==0&&alt_ifc==0) {
+	if (ifc==1&&alt_ifc==0) {
 		// SEE TRM 2.3.7
 		// reset toggles
 		RESETTOGGLE(0x02);

File examples/debugdevice_full_duplex/test.cpp

 		return 1;
 	}
 
-	libusb_claim_interface(hndl[0],0);
-	libusb_claim_interface(hndl[1],0);
+	libusb_claim_interface(hndl[0],1);
+	libusb_claim_interface(hndl[1],1);
 
-	libusb_set_interface_alt_setting(hndl[0], 0, 0);
-	libusb_set_interface_alt_setting(hndl[1], 0, 0);
+	libusb_set_interface_alt_setting(hndl[0], 1, 0);
+	libusb_set_interface_alt_setting(hndl[1], 1, 0);
 
 	for (i = 0; i < (int)sizeof(buf); i++)
 		buf[i] = i;
 
 	libusb_free_device_list(devlist, 1);
 	libusb_close(hndl[0]);
+	libusb_close(hndl[1]);
 	return 0;
 }