]> sigrok.org Git - libsigrok.git/commitdiff
transform/scale: Drop support for SR_DF_ANALOG_OLD.
authorUwe Hermann <redacted>
Sat, 14 May 2016 14:27:28 +0000 (16:27 +0200)
committerUwe Hermann <redacted>
Fri, 17 Jun 2016 13:13:12 +0000 (15:13 +0200)
src/transform/scale.c

index ef2d6b456d724a10814a518a5983cd0ec5be5624..5b412784d3416bb573d7f3d2b981576cecec3098 100644 (file)
@@ -49,33 +49,13 @@ static int receive(const struct sr_transform *t,
                struct sr_datafeed_packet **packet_out)
 {
        struct context *ctx;
-       const struct sr_datafeed_analog_old *analog_old;
        const struct sr_datafeed_analog *analog;
-       struct sr_channel *ch;
-       GSList *l;
-       float *fdata;
-       float factor;
-       int i, num_channels, c;
 
        if (!t || !t->sdi || !packet_in || !packet_out)
                return SR_ERR_ARG;
        ctx = t->priv;
 
        switch (packet_in->type) {
-       case SR_DF_ANALOG_OLD:
-               analog_old = packet_in->payload;
-               fdata = (float *)analog_old->data;
-               num_channels = g_slist_length(analog_old->channels);
-               factor = (float) ctx->factor.p / ctx->factor.q;
-               for (i = 0; i < analog_old->num_samples; i++) {
-                       /* For now scale all values in all channels. */
-                       for (l = analog_old->channels, c = 0; l; l = l->next, c++) {
-                               ch = l->data;
-                               (void)ch;
-                               fdata[i * num_channels + c] *= factor;
-                       }
-               }
-               break;
        case SR_DF_ANALOG:
                analog = packet_in->payload;
                analog->encoding->scale.p *= ctx->factor.p;