]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Added support for 20kHz and 25kHz sampling
authorJoel Holdsworth <redacted>
Mon, 7 May 2012 15:42:50 +0000 (16:42 +0100)
committerJoel Holdsworth <redacted>
Thu, 10 May 2012 12:10:59 +0000 (13:10 +0100)
hardware/fx2lafw/command.c
hardware/fx2lafw/fx2lafw.c

index fe16506aefbfc4a373e397fe085dc6edda16f6c5..b5ccbf4665ca845fe9363a254b2ac8c7ee0937f0 100644 (file)
@@ -68,7 +68,11 @@ SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
        if ((SR_MHZ(48) % samplerate) == 0) {
                cmd.flags = CMD_START_FLAGS_CLK_48MHZ;
                delay = SR_MHZ(48) / samplerate - 1;
-       } else if ((SR_MHZ(30) % samplerate) == 0) {
+               if(delay > MAX_SAMPLE_DELAY)
+                       delay = 0;
+       }
+
+       if (delay == 0 && (SR_MHZ(30) % samplerate) == 0) {
                cmd.flags = CMD_START_FLAGS_CLK_30MHZ;
                delay = SR_MHZ(30) / samplerate - 1;
        }
index 89bb18bf12a0d3c09fe845c61404718a36de9881..8132251f4410a296af06e03a3ae767bc52dd1f89 100644 (file)
@@ -94,6 +94,8 @@ static const char *probe_names[] = {
 };
 
 static uint64_t supported_samplerates[] = {
+       SR_KHZ(20),
+       SR_KHZ(25),
        SR_KHZ(50),
        SR_KHZ(100),
        SR_KHZ(200),