X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=main.c;h=271d28a99271f6c61f77570e897fe45aee32b1d4;hp=abacea964830707dbe30a5fc34f0006e078b3731;hb=dd2f206a287e1b13abf4307c940f874668d30113;hpb=26c63758bd4e5676cb6c987668ca46053c5e82bb
diff --git a/main.c b/main.c
index abacea9..271d28a 100644
--- a/main.c
+++ b/main.c
@@ -17,13 +17,10 @@
* along with this program. If not, see .
*/
+#include "sigrok-cli.h"
#include "config.h"
+#include
#include
-#include
-#ifdef HAVE_SRD
-#include /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#endif
-#include "sigrok-cli.h"
struct sr_context *sr_ctx = NULL;
#ifdef HAVE_SRD
@@ -137,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;
+ 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;
+ 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;
}