]> sigrok.org Git - libsigrok.git/blobdiff - hardware/gmc-mh-1x-2x/protocol.c
ikalogic-scanalogic2: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES.
[libsigrok.git] / hardware / gmc-mh-1x-2x / protocol.c
index 2b2b6966bc1eff168243730390cd5147d2901a5b..66a73e9f639965d0e5e86b3be2352275ac11bccb 100644 (file)
@@ -102,17 +102,17 @@ static void decode_ctmv_16(uint8_t ctmv, struct dev_context *devc)
 /**
  * Decode range/sign/acdc byte special chars (Metrahit 12-16).
  *
- * @param[in] spc Special characters 1 and 2 (s1 | (s2 << 4)).
+ * @param[in] rs Range and sign byte.
  */
 static void decode_rs_16(uint8_t rs, struct dev_context *devc)
 {
        sr_spew("decode_rs_16(%d) scale = %f", rs, devc->scale);
 
-       if (rs & 0x08) /* Sign */
+       if (rs & 0x04) /* Sign */
                devc->scale *= -1.0;
 
        if (devc->mq == SR_MQ_CURRENT) {
-               if (rs & 0x04) /* Current is AC */
+               if (rs & 0x08) /* Current is AC */
                        devc->mqflags |= SR_MQFLAG_AC;
                else
                        devc->mqflags |= SR_MQFLAG_DC;
@@ -130,7 +130,7 @@ static void decode_rs_16(uint8_t rs, struct dev_context *devc)
                                devc->mq = SR_MQ_TEMPERATURE;
                                devc->unit = SR_UNIT_CELSIUS;
                                devc->scale *= 0.01;
-                       } else if ((devc->scale1000 == 2)) {
+                       } else if (devc->scale1000 == 2) {
                                /* 16I Iso 500/1000V 3 GOhm */
                                devc->scale *= 0.1;
                        }