]> sigrok.org Git - libsigrok.git/commitdiff
dmm: vc870: keep the order when processing modes
authorWolfram Sang <redacted>
Sun, 3 Jan 2016 21:27:42 +0000 (22:27 +0100)
committerUwe Hermann <redacted>
Tue, 5 Jan 2016 21:25:29 +0000 (22:25 +0100)
is_power_apparent_power is index 0 of function 0x39, so it is better to
process it first and the later indices after that (we need to add
another one with a different patch later).

Signed-off-by: Wolfram Sang <redacted>
src/dmm/vc870.c

index ee61483b6aec61114477066c89dd990ded6d8955..2529f0baeb12f63c741fc7f97117e962e76908c5 100644 (file)
@@ -337,13 +337,6 @@ static void handle_flags(struct sr_datafeed_analog_old *analog,
                analog->mq = SR_MQ_POWER;
                analog->unit = SR_UNIT_WATT;
        }
-       if (info->is_power_factor_freq) {
-               /* TODO: Handle power factor. */
-               // analog->mq = SR_MQ_POWER_FACTOR;
-               // analog->unit = SR_UNIT_UNITLESS;
-               analog->mq = SR_MQ_FREQUENCY;
-               analog->unit = SR_UNIT_HERTZ;
-       }
        if (info->is_power_apparent_power) {
                analog->mq = SR_MQ_POWER;
                analog->unit = SR_UNIT_WATT;
@@ -351,6 +344,13 @@ static void handle_flags(struct sr_datafeed_analog_old *analog,
                // analog->mq = SR_MQ_APPARENT_POWER;
                // analog->unit = SR_UNIT_VOLT_AMPERE;
        }
+       if (info->is_power_factor_freq) {
+               /* TODO: Handle power factor. */
+               // analog->mq = SR_MQ_POWER_FACTOR;
+               // analog->unit = SR_UNIT_UNITLESS;
+               analog->mq = SR_MQ_FREQUENCY;
+               analog->unit = SR_UNIT_HERTZ;
+       }
 
        /* Measurement related flags */
        if (info->is_ac)