From c3e871dc8e7df18a49a0ac244b86c9f8cb488c82 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Sun, 29 Dec 2013 17:14:37 +0100 Subject: [PATCH] es519xx: apply the proper fixed factor in duty cycle mode --- hardware/common/dmm/es519xx.c | 4 ++++ 1 file changed, 4 insertions(+) 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)