X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Ftransform%2Fscale.c;h=c7c60dd2b456ac5bfa317bf76592a28fc2e84c38;hb=HEAD;hp=ef2d6b456d724a10814a518a5983cd0ec5be5624;hpb=a73665a3fa56f5997e20b24cc8c4fb8831ca131f;p=libsigrok.git diff --git a/src/transform/scale.c b/src/transform/scale.c index ef2d6b45..c7c60dd2 100644 --- a/src/transform/scale.c +++ b/src/transform/scale.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -49,33 +48,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;