|
|
|
@ -104,6 +104,8 @@ struct rtlsdr_dev { |
|
|
|
|
enum rtlsdr_async_status async_status; |
|
|
|
|
int async_cancel; |
|
|
|
|
int use_zerocopy; |
|
|
|
|
int keep_biast_on; |
|
|
|
|
int biast_gpio; |
|
|
|
|
/* rtl demod context */ |
|
|
|
|
uint32_t rate; /* Hz */ |
|
|
|
|
uint32_t rtl_xtal; /* Hz */ |
|
|
|
@ -1686,6 +1688,14 @@ int rtlsdr_close(rtlsdr_dev_t *dev) |
|
|
|
|
rtlsdr_deinit_baseband(dev); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Disable bias-tee unless we're explicitly asked |
|
|
|
|
* to keep it on. |
|
|
|
|
*/ |
|
|
|
|
if (dev->keep_biast_on == 0) { |
|
|
|
|
rtlsdr_set_bias_tee(dev, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
libusb_release_interface(dev->devh, 0); |
|
|
|
|
|
|
|
|
|
#ifdef DETACH_KERNEL_DRIVER |
|
|
|
@ -2060,8 +2070,12 @@ int rtlsdr_set_bias_tee(rtlsdr_dev_t *dev, int on) |
|
|
|
|
if (!dev) |
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
if(dev->force_bt) on = 1; // If force_bt is on from the EEPROM, do not allow bias tee to turn off
|
|
|
|
|
if(dev->force_bt) { |
|
|
|
|
on = 1; // If force_bt is on from the EEPROM, do not allow bias tee to turn off
|
|
|
|
|
dev->keep_biast_on = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dev->biast_gpio = 0; // always 0?
|
|
|
|
|
rtlsdr_set_gpio_output(dev, 0); |
|
|
|
|
rtlsdr_set_gpio_bit(dev, 0, on); |
|
|
|
|
|
|
|
|
@ -2080,3 +2094,12 @@ int rtlsdr_set_gpio(rtlsdr_dev_t *dev, int gpio_pin, int on) |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int rtlsdr_set_bias_tee_leave_on(rtlsdr_dev_t *dev, int leave_on) |
|
|
|
|
{ |
|
|
|
|
if (!dev) |
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
dev->keep_biast_on = leave_on; |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|