From: Frank Stettner Date: Fri, 23 Dec 2022 11:20:44 +0000 (+0100) Subject: dmm/metex14: fix values for digits properties X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=762356c34ec26704926483e63103b7bf3870363d;p=libsigrok.git dmm/metex14: fix values for digits properties Unify the metex14 package parser with the other drivers regarding the use of the digits properties in the analog payload. This commit adjusts the previously unclear, but now clarified, use of these properties: Number of significant digits after the decimal point, if positive. When negative, exponent with reversed polarity that is necessary to express the value with all digits without a decimal point. This commit partly reverts commit 7fb4ff0 --- diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c index d93052a8..1c751bd5 100644 --- a/src/dmm/metex14.c +++ b/src/dmm/metex14.c @@ -195,8 +195,6 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, { int factor; - (void)exponent; - /* Factors */ factor = 0; if (info->is_pico) @@ -212,6 +210,7 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, if (info->is_mega) factor += 6; *floatval *= powf(10, factor); + *exponent += factor; /* Measurement modes */ if (info->is_volt) {