]> sigrok.org Git - libsigrok.git/commitdiff
lascar-el-usb: properly submit CO concentration as a PPM value
authorBert Vermeulen <redacted>
Sat, 15 Dec 2012 21:49:40 +0000 (22:49 +0100)
committerBert Vermeulen <redacted>
Sat, 15 Dec 2012 21:49:40 +0000 (22:49 +0100)
hardware/lascar-el-usb/protocol.c

index db46ee5efd1e783faec81901adafe94b091fed74..f92611dafa2a201354909fd2cac6fd41a316ddad 100644 (file)
@@ -405,7 +405,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
                        break;
                for (i = 0; i < samples; i++) {
                        s = (buf[i * 2] << 8) | buf[i * 2 + 1];
-                       analog.data[i] = s * devc->co_high + devc->co_low;
+                       analog.data[i] = (s * devc->co_high + devc->co_low) / 1000000;
                        if (analog.data[i] < 0.0)
                                analog.data[i] = 0.0;
                }