]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/colead-slm/protocol.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / hardware / colead-slm / protocol.c
index 6b30459c361809dc1accb8fcd869dca554aac31e..570e7db33a6a918eecff07f11bf2a9817dcd09be 100644 (file)
@@ -74,7 +74,7 @@ static void process_packet(const struct sr_dev_inst *sdi)
        }
        fvalue /= 10;
 
-       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+       sr_analog_init(&analog, &encoding, &meaning, &spec, 1);
        analog.meaning->mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.meaning->unit = SR_UNIT_DECIBEL_SPL;
        analog.meaning->channels = sdi->channels;
@@ -138,7 +138,7 @@ static void process_packet(const struct sr_dev_inst *sdi)
        case 0x9:
                /* Mean over a time period between 11 seconds and 24 hours.
                 * Which is so silly that there's no point in expressing
-                * either this or the previous case.  */
+                * either this or the previous case. */
                analog.meaning->mqflags |= SR_MQFLAG_SPL_LAT \
                                | SR_MQFLAG_SPL_FREQ_WEIGHT_A \
                                | SR_MQFLAG_SPL_TIME_WEIGHT_F;
@@ -177,7 +177,7 @@ static void process_packet(const struct sr_dev_inst *sdi)
        sr_sw_limits_update_samples_read(&devc->limits, 1);
 
        if (sr_sw_limits_check(&devc->limits))
-               sdi->driver->dev_acquisition_stop((struct sr_dev_inst *)sdi);
+               sr_dev_acquisition_stop((struct sr_dev_inst *)sdi);
 }
 
 SR_PRIV int colead_slm_receive_data(int fd, int revents, void *cb_data)
@@ -202,7 +202,7 @@ SR_PRIV int colead_slm_receive_data(int fd, int revents, void *cb_data)
 
        serial = sdi->conn;
        if (devc->state == IDLE) {
-               if (serial_read_nonblocking(serial, buf, 128) != 1 || buf[0] != 0x10)
+               if (serial_read_nonblocking(serial, buf, sizeof(buf)) != 1 || buf[0] != 0x10)
                        /* Nothing there, or caught the tail end of a previous packet,
                         * or some garbage. Unless it's a single "data ready" byte,
                         * we don't want it. */