The previous implementation only emitted data for the first enabled
channels, and "saw no changes" after emission of the initial value for
channels on positions that followed a disabled channel.
Assume that the received data from the session bus communicates the bits
of enabled channels in a packed representation. Skip the mapping of
output bit indices to sigrok channel numbers.
This fixes the remaining part of bug #519.
Tested by inspecting in gtkwave the result of command:
$ sigrok-cli -d demo -C D1,D3,D6 -c samplerate=2M --samples 2500 -O vcd -o trace.vcd
When we find that all input sources (device drivers, and input modules)
provide a dense bit field, all of the mapping logic can get removed
here. This commit just quickly disables the logic.
timestamp_written = FALSE;
for (p = 0; p < ctx->num_enabled_channels; p++) {
- index = ctx->channel_index[p];
+ /*
+ * TODO Check whether the mapping from
+ * data image positions to channel numbers
+ * is required. Experiments suggest that
+ * the data image "is dense", and packs
+ * bits of enabled channels, and leaves no
+ * room for positions of disabled channels.
+ */
+ /* index = ctx->channel_index[p]; */
+ index = p;
curbit = ((unsigned)sample[index / 8]
>> (index % 8)) & 1;