X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Fvcd.c;h=44a12dec37a8c2e2265ea499d4410d61443d5ac3;hb=bc059b42a26bbfa1d64bbf617abe4d440bdc57c5;hp=8e2d1b2191d9e1f77825a58c9cdec33aeeac2e83;hpb=d3c74a6fb05118e32ad421443251b7b3288918f9;p=libsigrok.git diff --git a/output/vcd.c b/output/vcd.c index 8e2d1b21..44a12dec 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/vcd: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/vcd" struct context { int num_enabled_probes; @@ -69,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( @@ -131,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", @@ -190,7 +187,7 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi, for (p = 0; p < ctx->num_enabled_probes; p++) { index = g_array_index(ctx->probeindices, int, p); curbit = (sample[p / 8] & (((uint8_t) 1) << index)) >> index; - prevbit = (ctx->prevsample[p / 8] & (((uint64_t) 1) << index)) >> index; + prevbit = (ctx->prevsample[p / 8] & (((uint8_t) 1) << index)) >> index; /* VCD only contains deltas/changes of signals. */ if (prevbit == curbit)