]> sigrok.org Git - libsigrok.git/commitdiff
es519xx: correctly handle the VAHZ function
authorAurelien Jacobs <redacted>
Sun, 29 Dec 2013 16:15:42 +0000 (17:15 +0100)
committerUwe Hermann <redacted>
Sun, 29 Dec 2013 17:46:08 +0000 (18:46 +0100)
This handles the frequency and duty cycle display in voltage or current mode.

hardware/common/dmm/es519xx.c

index 66e6f5f5fd249a57c9a4f57052008e0ca2878203..510fd4f314688bdb405fe604707172c14f8d087a 100644 (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) {
                info->is_current = info->is_auto = FALSE;
                info->is_voltage = TRUE;