]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Fix analog scaling.
authorUwe Hermann <redacted>
Sun, 3 Jul 2016 21:03:52 +0000 (23:03 +0200)
committerUwe Hermann <redacted>
Sun, 3 Jul 2016 21:03:52 +0000 (23:03 +0200)
Thanks to Patrick Remy <redacted> for the fix.

src/hardware/fx2lafw/protocol.c

index 29bb0df51f2a1d8467e225a490fbfdfd2debfa78..2335842d59f709c218ba654f7ac2cc19411c0016 100644 (file)
@@ -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 = {