• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision5f956a1084803d3610fb26a4abe57859116ffb46 (tree)
Time2011-05-10 00:20:12
AuthorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

device lookup fix

Change Summary

Incremental Difference

--- a/usb.c
+++ b/usb.c
@@ -91,12 +91,17 @@ struct port_t *open_usb(unsigned short vid, unsigned short pid)
9191 for (bus = busses; bus; bus = bus->next) {
9292 for (dev = bus->devices; dev; dev = dev->next) {
9393 if ((dev->descriptor.idVendor == vid) &&
94- (dev->descriptor.idProduct == pid))
95- break;
94+ (dev->descriptor.idProduct == pid)) {
95+ goto found;
96+ }
9697 }
98+ dev = NULL;
9799 }
98- if (dev == NULL)
100+found:
101+ if (dev == NULL) {
102+ printf("USB device %04x:%04x not found\n", vid, pid);
99103 return NULL;
104+ }
100105 handle = usb_open(dev);
101106 if (handle == NULL) {
102107 puts(usb_strerror());