X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=main.c;h=271d28a99271f6c61f77570e897fe45aee32b1d4;hp=9ab3f77cc49baa64dae8e72e1a44ab19b841fb0d;hb=dd2f206a287e1b13abf4307c940f874668d30113;hpb=20fb52e08416238c60392b410f69856cc7d98650 diff --git a/main.c b/main.c index 9ab3f77..271d28a 100644 --- a/main.c +++ b/main.c @@ -19,6 +19,7 @@ #include "sigrok-cli.h" #include "config.h" +#include #include struct sr_context *sr_ctx = NULL; @@ -133,21 +134,22 @@ int select_probes(struct sr_dev_inst *sdi) struct sr_probe *probe; GSList *selected_probes, *l; - if (!opt_probes) - return SR_OK; + if (opt_probes) { + if (!(selected_probes = parse_probestring(sdi, opt_probes))) + return SR_ERR; - if (!(selected_probes = parse_probestring(sdi, opt_probes))) - return SR_ERR; - - for (l = sdi->probes; l; l = l->next) { - probe = l->data; - if (g_slist_find(selected_probes, probe)) - probe->enabled = TRUE; - else - probe->enabled = FALSE; + for (l = sdi->probes; l; l = l->next) { + probe = l->data; + if (g_slist_find(selected_probes, probe)) + probe->enabled = TRUE; + else + probe->enabled = FALSE; + } + g_slist_free(selected_probes); } - g_slist_free(selected_probes); - +#ifdef HAVE_SRD + map_pd_probes(sdi); +#endif return SR_OK; }