From: Aurelien Jacobs Date: Sun, 29 Dec 2013 16:15:42 +0000 (+0100) Subject: es519xx: correctly handle the VAHZ function X-Git-Tag: libsigrok-0.3.0~364 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=29bad967a437f3e14a01b043ccca483e890346bc;p=libsigrok.git es519xx: correctly handle the VAHZ function This handles the frequency and duty cycle display in voltage or current mode. --- diff --git a/hardware/common/dmm/es519xx.c b/hardware/common/dmm/es519xx.c index 66e6f5f5..510fd4f3 100644 --- a/hardware/common/dmm/es519xx.c +++ b/hardware/common/dmm/es519xx.c @@ -412,6 +412,23 @@ static void parse_flags(const uint8_t *buf, struct es519xx_info *info) } } + if (info->is_vahz && (info->is_voltage || info->is_current)) { + info->is_voltage = FALSE; + info->is_current = FALSE; + info->is_milli = info->is_micro = FALSE; + if (info->packet_size == 14) { + if (info->is_judge) + info->is_duty_cycle = TRUE; + else + info->is_frequency = TRUE; + } else { + if (info->is_judge) + info->is_rpm = TRUE; + else + info->is_frequency = TRUE; + } + } + if (info->is_current && (info->is_micro || info->is_milli) && info->is_vasel) { info->is_current = info->is_auto = FALSE; info->is_voltage = TRUE;