Skip to content

Commit

Permalink
libbladeRF: switch to RFLink mode if FPGA is programmed
Browse files Browse the repository at this point in the history
This commit was introduced because the change over to using USB alternate
settings causes the libusb to change the device to its first alt-interface when
it is released. This basically means that as soon as the command line is closed
the device goes back to alt-interface 0. This commit figures out when this
happens and manually goes back to RFLink mode, alt-interface #1.
  • Loading branch information
rghilduta committed Aug 26, 2013
1 parent bc5fc8c commit 1b4b3ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host/libraries/libbladeRF/src/backend/libusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ static int lusb_open(struct bladerf **device, struct bladerf_devinfo *info)
}
}

if (!status) {
if (lusb_is_fpga_configured(dev)) {
status = libusb_set_interface_alt_setting(lusb->handle, 0, USB_IF_RF_LINK);
}
}

/* XXX I'd prefer if we made a call here to lusb_close(), but that would result
* in an attempt to release interfaces we haven't claimed... thoughts? */
lusb_open__err_device_list:
Expand Down

0 comments on commit 1b4b3ac

Please sign in to comment.