Bug fix: usb_set_configuration causes problems on Linux.

Added #ifdef WIN32 around these calls.
This commit is contained in:
Daniel Beer 2011-07-30 12:51:44 +12:00
parent d045d8feec
commit 345ad4ae2d
2 changed files with 4 additions and 0 deletions

View File

@ -103,11 +103,13 @@ static int open_interface(struct olimex_transport *tr,
}
#endif
#ifdef WIN32
if (usb_set_configuration(tr->handle, 1) < 0) {
pr_error(__FILE__": can't set configuration 1");
usb_close(tr->handle);
return -1;
}
#endif
if (usb_claim_interface(tr->handle, tr->int_number) < 0) {
pr_error(__FILE__": can't claim interface");

View File

@ -74,11 +74,13 @@ static int open_interface(struct rf2500_transport *tr,
"detach kernel driver");
#endif
#ifdef WIN32
if (usb_set_configuration(tr->handle, 1) < 0) {
pr_error("rf2500: can't set configuration 1");
usb_close(tr->handle);
return -1;
}
#endif
if (usb_claim_interface(tr->handle, tr->int_number) < 0) {
pr_error("rf2500: can't claim interface");