From: Soeren Apel Date: Fri, 8 Sep 2017 16:14:47 +0000 (+0200) Subject: Fix #1024 by changing decode channel assigment to PDs X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=6e7a4a0066c15d99c891765bbc6797d339ac0ec8;hp=6e7a4a0066c15d99c891765bbc6797d339ac0ec8 Fix #1024 by changing decode channel assigment to PDs When assigning the decoder stack channels to the libsrd instance's channels, channels that had no signal assigned to them were still assigned anyway. This patch fixes this bug. After doing this, another subtle bug became apparent: The mapping between channels and bits in the data stream sent to the PD was done via DecodeChannel->id. This is however insufficient as the channels of the decoder stack have IDs that may or may not match the ID needed for the data stream. Example: A PD has 4 channels: A, B, C and D. In PV, those channels have the IDs 0, 1, 2 and 3. If the user only assigns A and D, Decoder::create_decoder_inst() will use the IDs 0 and 3 as the bit positions of those signals in the data stream sent to libsrd. This is obviously wrong. Hence, we now use a separate bit_id for this purpose. ---