]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/asix-sigma/asix-sigma.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / hardware / asix-sigma / asix-sigma.c
index bfd69484bf8b944e8db564bc82ccab03cdb33d93..55c6026cacbefb4661d5fd8bc7f961f231791d61 100644 (file)
@@ -71,7 +71,7 @@ static const char *channel_names[] = {
        "9", "10", "11", "12", "13", "14", "15", "16",
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
        SR_CONF_TRIGGER_MATCH,
@@ -813,7 +813,7 @@ static int cleanup(void)
        return dev_clear();
 }
 
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -824,7 +824,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                return SR_ERR;
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(devc->cur_samplerate);
                break;
@@ -841,7 +841,7 @@ 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(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
@@ -856,7 +856,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        devc = sdi->priv;
 
        ret = SR_OK;
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                ret = set_samplerate(sdi, g_variant_get_uint64(data));
                break;
@@ -885,7 +885,7 @@ 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(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        GVariant *gvar;
@@ -896,8 +896,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
@@ -907,7 +907,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_TRIGGER_MATCH:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                trigger_matches, ARRAY_SIZE(trigger_matches),
                                sizeof(int32_t));
                break;