]> sigrok.org Git - libsigrok.git/commitdiff
es519xx: apply the proper fixed factor in duty cycle mode
authorAurelien Jacobs <redacted>
Sun, 29 Dec 2013 16:14:37 +0000 (17:14 +0100)
committerUwe Hermann <redacted>
Sun, 29 Dec 2013 17:46:08 +0000 (18:46 +0100)
hardware/common/dmm/es519xx.c

index 838592ed4a253e1f96e0ba14856f4e873a32e29a..66e6f5f5fd249a57c9a4f57052008e0ca2878203 100644 (file)
@@ -169,6 +169,8 @@ static int parse_range(uint8_t b, float *floatval,
                mode = 7; /* Capacitance */
        else if (info->is_diode)
                mode = 8; /* Diode */
+       else if (info->is_duty_cycle)
+               mode = 0; /* Dummy, unused */
        else {
                sr_dbg("Invalid mode, range byte was: 0x%02x.", b);
                return SR_ERR;
@@ -180,6 +182,8 @@ static int parse_range(uint8_t b, float *floatval,
                else if (info->is_milli)
                        factor = (const float[]){1e-2, 1e-1}[idx];
        }
+       else if (info->is_duty_cycle)
+               factor = 1e-1;
        else if (info->baudrate == 2400)
                factor = factors_2400_11b[mode][idx];
        else if (info->fivedigits)