]> sigrok.org Git - libsigrok.git/commitdiff
es519xx: fix switching between frequency and duty cycle mode on 14 bytes chips
authorAurelien Jacobs <redacted>
Sun, 29 Dec 2013 16:07:42 +0000 (17:07 +0100)
committerUwe Hermann <redacted>
Sun, 29 Dec 2013 17:46:08 +0000 (18:46 +0100)
Here is what the datasheet says about this:
  "If judge bit is 1, it means frequency mode. If judge bit is 0,
   it means duty cycle mode."
But this is plain wrong. Reality proves this is the other way around.

hardware/common/dmm/es519xx.c

index 67d669a584211628b3a527b7e16edcec725f1a3e..838592ed4a253e1f96e0ba14856f4e873a32e29a 100644 (file)
@@ -369,9 +369,9 @@ static void parse_flags(const uint8_t *buf, struct es519xx_info *info)
                case 0x32: /* Frequency / RPM / duty cycle */
                        if (info->packet_size == 14) {
                                if (info->is_judge)
-                                       info->is_frequency = TRUE;
-                               else
                                        info->is_duty_cycle = TRUE;
+                               else
+                                       info->is_frequency = TRUE;
                        } else {
                                if (info->is_judge)
                                        info->is_rpm = TRUE;