]> sigrok.org Git - libsigrok.git/commitdiff
ols: Fix demuxer operation
authorv1ne <redacted>
Tue, 23 Feb 2021 21:36:33 +0000 (22:36 +0100)
committerSoeren Apel <redacted>
Fri, 10 Sep 2021 21:01:07 +0000 (23:01 +0200)
On my OLS with Demon Core (v3.07), the following command produces only low
levels on channels 8-15:
sigrok-cli -d ols:conn=/dev/ttyACM0 --output-format ascii:width=128 \
  --config='samplerate=200M:pattern=Internal:captureratio=50' \
  --channels 0-15 --samples 32 --triggers "12=1"

This doesn't make sense since it only triggers if channel 12 is high.
By not overwriting the channel data, I get the desired output. The data
is processed in groups of 2 bytes, so there's no need to fold back "input"
from devc->sample[2..3] because these bytes are always zero.

src/hardware/openbench-logic-sniffer/protocol.c

index bf065c760889ea21d2cfad6b93982eaec833c3d4..68022a1c6ae442cf45f5d8cb1cdf9e14aee446da 100644 (file)
@@ -487,12 +487,6 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data)
                                                 */
                                                tmp_sample[i] =
                                                        devc->sample[j++];
-                                       } else if (devc->capture_flags &
-                                                          CAPTURE_FLAG_DEMUX &&
-                                                  (i > 2)) {
-                                               /* group 2 & 3 get added to 0 & 1 */
-                                               tmp_sample[i - 2] =
-                                                       devc->sample[j++];
                                        }
                                }
                                memcpy(devc->sample, tmp_sample, 4);