From fe185e4990edba03faf6485dcd6a42aeb3b9a008 Mon Sep 17 00:00:00 2001 From: Alberto Scotta Date: Sat, 5 Dec 2020 16:05:51 +0100 Subject: [PATCH] hantek-dso: fix 100MS/s 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hardware/hantek-dso/protocol.c b/src/hardware/hantek-dso/protocol.c index c74187ad..d2101f2a 100644 --- a/src/hardware/hantek-dso/protocol.c +++ b/src/hardware/hantek-dso/protocol.c @@ -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) -- 2.30.2