mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-03 22:15:40 +01:00
squish invalid gain values to acceptable levels
This commit is contained in:
@@ -958,6 +958,7 @@ int ADDCALL hackrf_set_lna_gain(hackrf_device* device, uint32_t value)
|
||||
return HACKRF_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
value &= ~(1<<3);
|
||||
result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||
@@ -987,6 +988,7 @@ int ADDCALL hackrf_set_vga_gain(hackrf_device* device, uint32_t value)
|
||||
return HACKRF_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
value &= ~(1<<0);
|
||||
result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||
|
||||
Reference in New Issue
Block a user