From: Bert Vermeulen Date: Sun, 29 Dec 2013 09:57:38 +0000 (+0100) Subject: Skip analog probes in logic-only output formats. X-Git-Tag: libsigrok-0.3.0~378 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=3699a8a1ff68a2f5f781c6ae74946adc8bc82673;p=libsigrok.git Skip analog probes in logic-only output formats. --- diff --git a/output/chronovu_la8.c b/output/chronovu_la8.c index 47b421d9..e16f6174 100644 --- a/output/chronovu_la8.c +++ b/output/chronovu_la8.c @@ -108,6 +108,8 @@ static int init(struct sr_output *o) /* Get the unitsize. */ for (l = o->sdi->probes; l; l = l->next) { probe = l->data; + if (probe->type != SR_PROBE_LOGIC) + continue; if (!probe->enabled) continue; ctx->num_enabled_probes++; diff --git a/output/csv.c b/output/csv.c index 51cc8572..6de9ac3f 100644 --- a/output/csv.c +++ b/output/csv.c @@ -76,8 +76,11 @@ static int init(struct sr_output *o) /* Get the number of probes, and the unitsize. */ for (l = o->sdi->probes; l; l = l->next) { probe = l->data; - if (probe->enabled) - ctx->num_enabled_probes++; + if (probe->type != SR_PROBE_LOGIC) + continue; + if (!probe->enabled) + continue; + ctx->num_enabled_probes++; } ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; @@ -107,8 +110,11 @@ static int init(struct sr_output *o) ctx->num_enabled_probes, num_probes); for (l = o->sdi->probes; l; l = l->next) { probe = l->data; - if (probe->enabled) - g_string_append_printf(ctx->header, "%s, ", probe->name); + if (probe->type != SR_PROBE_LOGIC) + continue; + if (!probe->enabled) + continue; + g_string_append_printf(ctx->header, "%s, ", probe->name); } g_string_append_printf(ctx->header, "\n"); diff --git a/output/gnuplot.c b/output/gnuplot.c index 29508cef..27a764c8 100644 --- a/output/gnuplot.c +++ b/output/gnuplot.c @@ -80,8 +80,11 @@ static int init(struct sr_output *o) ctx->num_enabled_probes = 0; for (l = o->sdi->probes; l; l = l->next) { probe = l->data; - if (probe->enabled) - ctx->num_enabled_probes++; + if (probe->type != SR_PROBE_LOGIC) + continue; + if (!probe->enabled) + continue; + ctx->num_enabled_probes++; } ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; @@ -106,6 +109,8 @@ static int init(struct sr_output *o) wbuf[0] = '\0'; for (i = 0, l = o->sdi->probes; l; l = l->next, i++) { probe = l->data; + if (probe->type != SR_PROBE_LOGIC) + continue; if (!probe->enabled) continue; c = (char *)&wbuf + strlen((const char *)&wbuf); diff --git a/output/ols.c b/output/ols.c index 0e220534..9f9cc957 100644 --- a/output/ols.c +++ b/output/ols.c @@ -71,8 +71,11 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx) num_enabled_probes = 0; for (l = sdi->probes; l; l = l->next) { probe = l->data; - if (probe->enabled) - num_enabled_probes++; + if (probe->type != SR_PROBE_LOGIC) + continue; + if (!probe->enabled) + continue; + num_enabled_probes++; } s = g_string_sized_new(512); diff --git a/output/text/text.c b/output/text/text.c index 68566121..47d0542b 100644 --- a/output/text/text.c +++ b/output/text/text.c @@ -92,6 +92,8 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode) for (l = o->sdi->probes; l; l = l->next) { probe = l->data; + if (probe->type != SR_PROBE_LOGIC) + continue; if (!probe->enabled) continue; ctx->probenames = g_slist_append(ctx->probenames, probe->name); diff --git a/output/vcd.c b/output/vcd.c index d1526c1b..44a12dec 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -62,6 +62,8 @@ static int init(struct sr_output *o) for (l = o->sdi->probes; l; l = l->next) { probe = l->data; + if (probe->type != SR_PROBE_LOGIC) + continue; if (!probe->enabled) continue; ctx->probeindices = g_array_append_val( @@ -124,6 +126,8 @@ static int init(struct sr_output *o) /* Wires / channels */ for (i = 0, l = o->sdi->probes; l; l = l->next, i++) { probe = l->data; + if (probe->type != SR_PROBE_LOGIC) + continue; if (!probe->enabled) continue; g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n",