hantek-dso: fix 100MS/s
authorAlberto Scotta <albertoscotta93@gmail.com>
Sat, 5 Dec 2020 15:05:51 +0000 (16:05 +0100)
committerSoeren Apel <soeren@apelpie.net>
Sun, 21 Feb 2021 22:01:58 +0000 (23:01 +0100)
Do not downsample at 100MS/s.
The device actually sampled at (100.0/0x1000)MS/s when 100MS/s was set.

src/hardware/hantek-dso/protocol.c

index c74187ada435f2441e7aa3b88ed926194c9d530b..d2101f2a8170c892af1311c7a0e12f482aa3d84e 100644 (file)
@@ -326,7 +326,8 @@ static int dso2250_set_trigger_samplerate(const struct sr_dev_inst *sdi)
        }
 
        tmp = base / devc->samplerate;
-       if (tmp) {
+       /* Downsample only if really necessary */
+       if (tmp > 1) {
                /* Downsampling on */
                cmdstring[2] |= 2;
                /* Downsampler = 1comp((Base / Samplerate) - 2)