X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Fanalog.c;h=68d1b623849b819cbeb2ca3fb184683363aac46b;hb=a1be7b6c3f1f00644bdae96317f14b99fe31cf3d;hp=d2f28b6b2853bf94d6bb2ad91eea4c750c688900;hpb=bf53457d1ddea58d1cb7e4feea83ad0cc1d63031;p=libsigrok.git diff --git a/output/analog.c b/output/analog.c index d2f28b6b..68d1b623 100644 --- a/output/analog.c +++ b/output/analog.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2012 Bert Vermeulen * @@ -191,10 +191,12 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet) { - const struct sr_datafeed_analog *analog; struct context *ctx; + const struct sr_datafeed_analog *analog; + struct sr_probe *probe; + GSList *l; const float *fdata; - int i, j; + int i, p; (void)sdi; @@ -216,11 +218,11 @@ static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi, analog = packet->payload; fdata = (const float *)analog->data; for (i = 0; i < analog->num_samples; i++) { - for (j = 0; j < ctx->num_enabled_probes; j++) { - g_string_append_printf(ctx->out, "%s: ", - (char *)g_ptr_array_index(ctx->probelist, j)); + for (l = analog->probes, p = 0; l; l = l->next, p++) { + probe = l->data; + g_string_append_printf(ctx->out, "%s: ", probe->name); fancyprint(analog->unit, analog->mqflags, - fdata[i + j], ctx->out); + fdata[i + p], ctx->out); } } break;