From: Aurelien Jacobs Date: Sun, 29 Dec 2013 16:14:37 +0000 (+0100) Subject: es519xx: apply the proper fixed factor in duty cycle mode X-Git-Tag: libsigrok-0.3.0~365 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c3e871dc8e7df18a49a0ac244b86c9f8cb488c82;p=libsigrok.git es519xx: apply the proper fixed factor in duty cycle mode --- diff --git a/hardware/common/dmm/es519xx.c b/hardware/common/dmm/es519xx.c index 838592ed..66e6f5f5 100644 --- a/hardware/common/dmm/es519xx.c +++ b/hardware/common/dmm/es519xx.c @@ -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)