]> sigrok.org Git - libsigrok.git/commit
demo: Unbreak execution with all analog channels disabled
authorGerhard Sittig <redacted>
Sat, 17 Jun 2017 15:58:45 +0000 (17:58 +0200)
committerUwe Hermann <redacted>
Fri, 23 Jun 2017 17:33:24 +0000 (19:33 +0200)
commitd91d0b12505c4c9062e0b66775fa9d8431429f49
tree6ddcdfff4b959c66539e039beca63533cd09c40a
parentf1c79a6a35122139d41be5ba1fcbaa02ec274eb5
demo: Unbreak execution with all analog channels disabled

The 'demo' driver supports scan options to adjust the number of
supported channels, and runtime control for the enabled state of
channels.

Starting with zero analog channels created (scan option) resulted in a
runtime assertion. Creating but disabling analog channels (GUI checkbox,
CLI option) resulted in unexpected output for disabled channels.

Move the creation of a hash table out of the conditional loop that
iterates over created analog channels. Which results in the table's
always being valid, and iteration during data acquisition yields no
analog output as is expected.

This fixes bug #625.
src/hardware/demo/api.c