summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-09-06 00:37:35 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-09-06 00:37:35 +0200
commit5b2595b5c944e85f15947da8aff69ce630ed9689 (patch)
treebc8a00b6046555ea587d4931c327b1bd6d6a7847 /instance.c
parentb677e536891fc19d949217023df622e30531220c (diff)
downloadlibsigrokdecode-5b2595b5c944e85f15947da8aff69ce630ed9689.tar.gz
libsigrokdecode-5b2595b5c944e85f15947da8aff69ce630ed9689.zip
Clarify and improve channel map debug output.
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/instance.c b/instance.c
index a47ce69..9dfc901 100644
--- a/instance.c
+++ b/instance.c
@@ -255,14 +255,20 @@ SRD_API int srd_inst_channel_set_all(struct srd_decoder_inst *di,
}
pdch = sl->data;
new_channelmap[pdch->order] = new_channelnum;
- srd_dbg("Setting channel mapping: %s (index %d) = channel %d.",
+ srd_dbg("Setting channel mapping: %s (PD ch idx %d) = input data ch idx %d.",
pdch->id, pdch->order, new_channelnum);
}
srd_dbg("Final channel map:");
num_required_channels = g_slist_length(di->decoder->channels);
for (i = 0; i < di->dec_num_channels; i++) {
- srd_dbg(" - index %d = channel %d (%s)", i, new_channelmap[i],
+ GSList *l = g_slist_nth(di->decoder->channels, i);
+ if (!l)
+ l = g_slist_nth(di->decoder->opt_channels,
+ i - num_required_channels);
+ pdch = l->data;
+ srd_dbg(" - PD ch idx %d (%s) = input data ch idx %d (%s)", i,
+ pdch->id, new_channelmap[i],
(i < num_required_channels) ? "required" : "optional");
}