]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/conrad-digi-35-cpu/api.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / hardware / conrad-digi-35-cpu / api.c
index 01adcef8ab2fec517fb322b0024d5ce5dd991122..a2a881598b1b6b1798faed0d0ce636f8d5100600 100644 (file)
 
 #define SERIALCOMM "9600/8n1"
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_POWER_SUPPLY,
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_CURRENT,
        /* There's no SR_CONF_OUTPUT_ENABLED; can't know/set status remotely. */
-       SR_CONF_OVER_CURRENT_PROTECTION,
+       SR_CONF_OVER_CURRENT_PROTECTION_ENABLED,
 };
 
 SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info;
@@ -121,7 +121,7 @@ static int cleanup(void)
        return std_dev_clear(di, NULL);
 }
 
-static int config_set(int key, 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)
 {
        int ret;
@@ -151,7 +151,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                ret = send_msg1(sdi, 'C', (int) (dblval * 100 + 0.5));
                break;
        /* No SR_CONF_OUTPUT_ENABLED :-( . */
-       case SR_CONF_OVER_CURRENT_PROTECTION:
+       case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED:
                if (g_variant_get_boolean(data))
                        ret = send_msg1(sdi, 'V', 900);
                else /* Constant current mode */
@@ -164,7 +164,7 @@ static int config_set(int key, 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)
 {
        int ret;
@@ -175,12 +175,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        ret = SR_OK;
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
                break;
        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;
        default:
                return SR_ERR_NA;