Merge pull request #177 from ckuethe/master
Explain which gain setting was unacceptable
This commit is contained in:
@ -581,6 +581,12 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (lna_gain % 8)
|
||||
printf("warning: lna_gain (-l) must be a multiple of 8\n");
|
||||
|
||||
if (vga_gain % 2)
|
||||
printf("warning: vga_gain (-g) must be a multiple of 2\n");
|
||||
|
||||
if (samples_to_xfer >= SAMPLES_TO_XFER_MAX) {
|
||||
printf("argument error: num_samples must be less than %s/%sMio\n",
|
||||
u64toa(SAMPLES_TO_XFER_MAX,&ascii_u64_data1),
|
||||
|
@ -1211,6 +1211,7 @@ int ADDCALL hackrf_set_lna_gain(hackrf_device* device, uint32_t value)
|
||||
return HACKRF_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
value &= ~0x07;
|
||||
result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||
@ -1240,6 +1241,7 @@ int ADDCALL hackrf_set_vga_gain(hackrf_device* device, uint32_t value)
|
||||
return HACKRF_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
value &= ~0x01;
|
||||
result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||
|
Reference in New Issue
Block a user