]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/chronovu-la8.c
sr: chronovu-la8: Add missing <stdlib.h> #include.
[libsigrok.git] / hardware / chronovu-la8 / chronovu-la8.c
index 18357827dadd1b919e6fac69ff0b621fc30fc405..8b3a7f8418c5c32df2e5ef504776f103f138b275 100644 (file)
@@ -21,6 +21,7 @@
 #include <ftdi.h>
 #include <glib.h>
 #include <string.h>
+#include <stdlib.h>
 #include "sigrok.h"
 #include "sigrok-internal.h"
 
@@ -60,9 +61,6 @@ struct la8 {
        /** The currently configured samplerate of the device. */
        uint64_t cur_samplerate;
 
-       /** period in picoseconds corresponding to the samplerate */
-       uint64_t period_ps;
-
        /** The current sampling limit (in ms). */
        uint64_t limit_msec;
 
@@ -493,7 +491,6 @@ static int hw_init(const char *deviceinfo)
        /* Set some sane defaults. */
        la8->ftdic = NULL;
        la8->cur_samplerate = SR_MHZ(100); /* 100MHz == max. samplerate */
-       la8->period_ps = 10000;
        la8->limit_msec = 0;
        la8->limit_samples = 0;
        la8->session_id = NULL;
@@ -643,7 +640,6 @@ static int set_samplerate(struct sr_device_instance *sdi, uint64_t samplerate)
 
        /* Set the new samplerate. */
        la8->cur_samplerate = samplerate;
-       la8->period_ps = 1000000000000 / samplerate;
 
        sr_dbg("la8: samplerate set to %" PRIu64 "Hz", la8->cur_samplerate);
 
@@ -935,8 +931,6 @@ static void send_block_to_session_bus(struct la8 *la8, int block)
                sr_spew("la8: sending SR_DF_LOGIC packet (%d bytes) for "
                        "block %d", BS, block);
                packet.type = SR_DF_LOGIC;
-               packet.timeoffset = block * BS * la8->period_ps;
-               packet.duration = BS * la8->period_ps;
                packet.payload = &logic;
                logic.length = BS;
                logic.unitsize = 1;
@@ -960,8 +954,6 @@ static void send_block_to_session_bus(struct la8 *la8, int block)
                sr_spew("la8: sending pre-trigger SR_DF_LOGIC packet, "
                        "start = %d, length = %d", block * BS, trigger_point);
                packet.type = SR_DF_LOGIC;
-               packet.timeoffset = block * BS * la8->period_ps;
-               packet.duration = trigger_point * la8->period_ps;
                packet.payload = &logic;
                logic.length = trigger_point;
                logic.unitsize = 1;
@@ -973,8 +965,6 @@ static void send_block_to_session_bus(struct la8 *la8, int block)
        sr_spew("la8: sending SR_DF_TRIGGER packet, sample = %d",
                (block * BS) + trigger_point);
        packet.type = SR_DF_TRIGGER;
-       packet.timeoffset = (block * BS + trigger_point) * la8->period_ps;
-       packet.duration = 0;
        packet.payload = NULL;
        sr_session_bus(la8->session_id, &packet);
 
@@ -985,8 +975,6 @@ static void send_block_to_session_bus(struct la8 *la8, int block)
                        "start = %d, length = %d",
                        (block * BS) + trigger_point, BS - trigger_point);
                packet.type = SR_DF_LOGIC;
-               packet.timeoffset = (block * BS + trigger_point) * la8->period_ps;
-               packet.duration = (BS - trigger_point) * la8->period_ps;
                packet.payload = &logic;
                logic.length = BS - trigger_point;
                logic.unitsize = 1;
@@ -1006,7 +994,7 @@ static int receive_data(int fd, int revents, void *session_data)
        (void)revents;
 
        if (!(sdi = session_data)) {
-               sr_err("la8: %s: user_data was NULL", __func__);
+               sr_err("la8: %s: session_data was NULL", __func__);
                return FALSE;
        }
 
@@ -1101,7 +1089,6 @@ static int hw_start_acquisition(int device_index, gpointer session_data)
        gettimeofday(&header.starttime, NULL);
        header.samplerate = la8->cur_samplerate;
        header.num_logic_probes = NUM_PROBES;
-       header.num_analog_probes = 0;
        sr_session_bus(session_data, &packet);
 
        /* Time when we should be done (for detecting trigger timeouts). */
@@ -1140,7 +1127,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_data)
        sr_session_bus(session_data, &packet);
 }
 
-struct sr_device_plugin chronovu_la8_plugin_info = {
+SR_PRIV struct sr_device_plugin chronovu_la8_plugin_info = {
        .name = "chronovu-la8",
        .longname = "ChronoVu LA8",
        .api_version = 1,