]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
Consistently use 'cg' for channel group variables.
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index a0975776be0490fc7e7dd229c7e3171affe26b7e..5b39f0a25a27c9f18f3b7fb6e122eee4c0238048 100644 (file)
@@ -383,13 +383,13 @@ static int bin2bitbang(const char *filename,
 static void clear_helper(void *priv)
 {
        struct dev_context *devc;
-       
+
        devc = priv;
 
        ftdi_deinit(&devc->ftdic);
 }
 
-static int clear_instances(void)
+static int dev_clear(void)
 {
        return std_dev_clear(di, clear_helper);
 }
@@ -741,13 +741,16 @@ static int dev_close(struct sr_dev_inst *sdi)
 
 static int cleanup(void)
 {
-       return clear_instances();
+       return dev_clear();
 }
 
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
+       (void)cg;
+
        switch (id) {
        case SR_CONF_SAMPLERATE:
                if (sdi) {
@@ -763,11 +766,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
        int ret;
 
+       (void)cg;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
@@ -794,12 +800,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        return ret;
 }
 
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_channel_group *cg)
 {
        GVariant *gvar;
        GVariantBuilder gvb;
 
        (void)sdi;
+       (void)cg;
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
@@ -1053,7 +1061,7 @@ static int receive_data(int fd, int revents, void *cb_data)
 
                /* Find first ts. */
                if (devc->state.chunks_downloaded == 0) {
-                       devc->state.lastts = *(uint16_t *) buf - 1;
+                       devc->state.lastts = RL16(buf) - 1;
                        devc->state.lastsample = 0;
                }
 
@@ -1398,7 +1406,7 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = {
        .cleanup = cleanup,
        .scan = scan,
        .dev_list = dev_list,
-       .dev_clear = clear_instances,
+       .dev_clear = dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,