mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-02-05 14:54:58 +01:00
lib: reset device if needed
This improves the situation on hosts with flaky host controllers like the Raspberry Pi and the WR703N. Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
4b057fea0f
commit
7840ec21d3
@ -1344,6 +1344,12 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
|
|||||||
|
|
||||||
dev->rtl_xtal = DEF_RTL_XTAL_FREQ;
|
dev->rtl_xtal = DEF_RTL_XTAL_FREQ;
|
||||||
|
|
||||||
|
/* perform a dummy write, if it fails, reset the device */
|
||||||
|
if (rtlsdr_write_reg(dev, USBB, USB_SYSCTL, 0x09, 1) < 0) {
|
||||||
|
fprintf(stderr, "Resetting device...\n");
|
||||||
|
libusb_reset_device(dev->devh);
|
||||||
|
}
|
||||||
|
|
||||||
rtlsdr_init_baseband(dev);
|
rtlsdr_init_baseband(dev);
|
||||||
|
|
||||||
/* Probe tuners */
|
/* Probe tuners */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user