From: Uwe Hermann Date: Sun, 3 Jul 2016 21:03:52 +0000 (+0200) Subject: fx2lafw: Fix analog scaling. X-Git-Tag: libsigrok-0.5.0~287 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2ab0679a340cf0dfb22debdbd79b229a8aed27fb;p=libsigrok.git fx2lafw: Fix analog scaling. Thanks to Patrick Remy for the fix. --- diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index 29bb0df5..2335842d 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -405,7 +405,7 @@ SR_PRIV void mso_send_data_proc(struct sr_dev_inst *sdi, for (i = 0; i < length; i++) { devc->logic_buffer[i] = data[i * 2]; /* Rescale to -10V - +10V from 0-255. */ - devc->analog_buffer[i] = data[i * 2 + 1] - 128.0f / 12.8f; + devc->analog_buffer[i] = (data[i * 2 + 1] - 128.0f) / 12.8f; }; const struct sr_datafeed_logic logic = {