usb_f107: Fixed lost 4 bytes on control OUT transaction.

This commit is contained in:
Gareth McMullin
2011-10-30 20:19:29 +13:00
committed by Piotr Esden-Tempski
parent 1fea1df39a
commit e0fe43357d
2 changed files with 37 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
import usb.core
if __name__ == "__main__":
dev = usb.core.find(idVendor=0xcafe, idProduct=0xcafe)
if dev is None:
raise ValueError('Device not found')
dev.set_configuration()
import gtk
w = gtk.Window()
w.connect("destroy", gtk.main_quit)
toggle = gtk.ToggleButton("Toggle LED")
def toggled(button):
dev.ctrl_transfer(0x40, 0, button.get_active(), 0, 'Hello World!')
toggle.connect("toggled", toggled)
w.add(toggle)
w.show_all()
gtk.main()