dmm: vc870: show display value properly in debug output
It was confusing to see the display value (5 digits) printed in debug output as a float. Print it the same way as shown on the real device, without comma, of course. This also allows to simplify the code a little. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
32ba0d8005
commit
b89462e457
|
@ -61,7 +61,6 @@ static int parse_value(const uint8_t *buf, struct vc870_info *info,
|
||||||
float *result)
|
float *result)
|
||||||
{
|
{
|
||||||
int i, intval;
|
int i, intval;
|
||||||
float floatval;
|
|
||||||
|
|
||||||
/* Bytes 3-7: Main display value (5 decimal digits) */
|
/* Bytes 3-7: Main display value (5 decimal digits) */
|
||||||
if (info->is_open || info->is_ol1) {
|
if (info->is_open || info->is_ol1) {
|
||||||
|
@ -86,13 +85,11 @@ static int parse_value(const uint8_t *buf, struct vc870_info *info,
|
||||||
intval *= info->is_sign1 ? -1 : 1;
|
intval *= info->is_sign1 ? -1 : 1;
|
||||||
// intval *= info->is_sign2 ? -1 : 1; /* TODO: Fahrenheit / aux display. */
|
// intval *= info->is_sign2 ? -1 : 1; /* TODO: Fahrenheit / aux display. */
|
||||||
|
|
||||||
floatval = (float)intval;
|
|
||||||
|
|
||||||
/* Note: The decimal point position will be parsed later. */
|
/* Note: The decimal point position will be parsed later. */
|
||||||
|
|
||||||
sr_spew("The display value is %f.", floatval);
|
sr_spew("The display value without comma is %05d.", intval);
|
||||||
|
|
||||||
*result = floatval;
|
*result = (float)intval;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue