]> sigrok.org Git - sigrok-cli.git/blobdiff - main.c
decode: Defer probe setup until after the input probes are known
[sigrok-cli.git] / main.c
diff --git a/main.c b/main.c
index 5dcee2cd25d680709ae5506ee66efa6dadefe75f..271d28a99271f6c61f77570e897fe45aee32b1d4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -134,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 (!(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;
+       if (opt_probes) {
+               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;
+               }
+               g_slist_free(selected_probes);
        }
-       g_slist_free(selected_probes);
-
+#ifdef HAVE_SRD
+       map_pd_probes(sdi);
+#endif
        return SR_OK;
 }