]> sigrok.org Git - libsigrok.git/blobdiff - src/dmm/ut372.c
dmm: vc870: fix AC conversion factors
[libsigrok.git] / src / dmm / ut372.c
index d9c7720fd16bce17323271ef0c25554c7caa4131..74f8757555c15abbe5a2d55ba2886950d7a419b6 100644 (file)
  * UNI-T UT372 protocol parser.
  */
 
+#include <config.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <math.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
 #define LOG_PREFIX "ut372"
@@ -87,7 +88,7 @@ SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf)
 }
 
 SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval,
-               struct sr_datafeed_analog *analog, void *info)
+               struct sr_datafeed_analog_old *analog, void *info)
 {
        unsigned int i, j, value, divisor;
        uint8_t segments, flags1, flags2;
@@ -118,7 +119,7 @@ SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval,
        divisor = 1;
 
        for (i = 0; i < 5; i++) {
-               segments = decode_pair(buf + 1 + 2*i);
+               segments = decode_pair(buf + 1 + (2 * i));
                for (j = 0; j < ARRAY_SIZE(lookup); j++) {
                        if (lookup[j] == (segments & ~DECIMAL_POINT_MASK)) {
                                value += j * pow(10, i);