]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/chronovu-la/api.c
drivers: Use timer sources instead of polling stdin
[libsigrok.git] / src / hardware / chronovu-la / api.c
index 7d4aae042361fbb1c1a57e0633a7a8049f03fc69..d735e1e1729a910c5dc3c7bf55d69e702e49e68d 100644 (file)
@@ -39,7 +39,7 @@ static const int32_t trigger_matches[] = {
 };
 
 /* The ChronoVu LA8/LA16 can have multiple VID/PID pairs. */
-static struct {
+static const struct {
        uint16_t vid;
        uint16_t pid;
        int model;
@@ -83,7 +83,7 @@ static int add_device(int idx, int model, GSList **devices)
 
        ret = SR_OK;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        /* Allocate memory for our private device context. */
        devc = g_malloc0(sizeof(struct dev_context));
@@ -128,7 +128,7 @@ static int add_device(int idx, int model, GSList **devices)
 
        for (i = 0; i < devc->prof->num_channels; i++)
                sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
-                                   cv_channel_names[i]);
+                               cv_channel_names[i]);
 
        *devices = g_slist_append(*devices, sdi);
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -191,7 +191,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -504,7 +504,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        devc->trigger_found = 0;
 
        /* Hook up a dummy handler to receive data from the device. */
-       sr_session_source_add(sdi->session, -1, G_IO_IN, 0, receive_data, (void *)sdi);
+       sr_session_source_add(sdi->session, -1, 0, 0, receive_data, (void *)sdi);
 
        return SR_OK;
 }
@@ -542,5 +542,5 @@ SR_PRIV struct sr_dev_driver chronovu_la_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };