es519xx: correctly handle the VAHZ function

This handles the frequency and duty cycle display in voltage or current mode.
This commit is contained in:
Aurelien Jacobs 2013-12-29 17:15:42 +01:00 committed by Uwe Hermann
parent c3e871dc8e
commit 29bad967a4
1 changed files with 17 additions and 0 deletions

View File

@ -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) { if (info->is_current && (info->is_micro || info->is_milli) && info->is_vasel) {
info->is_current = info->is_auto = FALSE; info->is_current = info->is_auto = FALSE;
info->is_voltage = TRUE; info->is_voltage = TRUE;