]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/dmm/rs9lcd.c
GPL headers: Use correct project name.
[libsigrok.git] / hardware / common / dmm / rs9lcd.c
index d184aca712736d434d661c60ecab508aca535a86..8297a077dc4a008f22df09b6234bdc7eb920aef3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
  *
  * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
  *
@@ -262,7 +262,7 @@ static uint8_t decode_digit(uint8_t raw_digit)
 
 static double lcd_to_double(const struct rs9lcd_packet *rs_packet, int type)
 {
-       double rawval, multiplier = 1;
+       double rawval = 0, multiplier = 1;
        uint8_t digit, raw_digit;
        gboolean dp_reached = FALSE;
        int i, end;
@@ -369,7 +369,7 @@ SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval,
        case MODE_CONT:
                analog->mq = SR_MQ_CONTINUITY;
                analog->unit = SR_UNIT_BOOLEAN;
-               *analog->data = is_shortcirc(rs_packet);
+               rawval = is_shortcirc(rs_packet);
                break;
        case MODE_DIODE:
                analog->mq = SR_MQ_VOLTAGE;
@@ -394,7 +394,7 @@ SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval,
                } else {
                        /* We have either HI or LOW. */
                        analog->unit = SR_UNIT_BOOLEAN;
-                       *analog->data = is_logic_high(rs_packet);
+                       rawval = is_logic_high(rs_packet);
                }
                break;
        case MODE_HFE:
@@ -412,10 +412,11 @@ SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval,
        case MODE_AMP_WIDTH:
                analog->mq = SR_MQ_PULSE_WIDTH;
                analog->unit = SR_UNIT_SECOND;
+               break;
        case MODE_TEMP:
                analog->mq = SR_MQ_TEMPERATURE;
                /* We need to reparse. */
-               *analog->data = lcd_to_double(rs_packet, READ_TEMP);
+               rawval = lcd_to_double(rs_packet, READ_TEMP);
                analog->unit = is_celsius(rs_packet) ?
                                SR_UNIT_CELSIUS : SR_UNIT_FAHRENHEIT;
                break;