fx2lafw: Added a check to limit the sample rate during 16-bit sampling
This commit is contained in:
parent
d1ddc7a9a8
commit
f4575b6549
|
@ -66,6 +66,12 @@ SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
|
|||
int delay = 0, ret;
|
||||
|
||||
/* Compute the sample rate. */
|
||||
if(samplewide && samplerate > MAX_16BIT_SAMPLE_RATE) {
|
||||
sr_err("fx2lafw: Unable to sample at %" PRIu64 "Hz "
|
||||
"when collecting 16-bit samples.", samplerate);
|
||||
return SR_ERR;
|
||||
}
|
||||
|
||||
if ((SR_MHZ(48) % samplerate) == 0) {
|
||||
cmd.flags = CMD_START_FLAGS_CLK_48MHZ;
|
||||
delay = SR_MHZ(48) / samplerate - 1;
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
|
||||
#define FX2LAFW_REQUIRED_VERSION_MAJOR 1
|
||||
|
||||
#define MAX_8BIT_SAMPLE_RATE SR_MHZ(24)
|
||||
#define MAX_16BIT_SAMPLE_RATE SR_MHZ(12)
|
||||
|
||||
/* 6 delay states of up to 256 clock ticks */
|
||||
#define MAX_SAMPLE_DELAY (6 * 256)
|
||||
|
||||
|
|
Loading…
Reference in New Issue