]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/zeroplus-logic-cube/api.c
drivers: Consistently use the exact driver name as LOG_PREFIX.
[libsigrok.git] / src / hardware / zeroplus-logic-cube / api.c
index dd0e66d5de91e48306284fc478927f0b7c274449..c3ee8017fa554251d4759203bffe80a7c7acfd51 100644 (file)
@@ -20,7 +20,6 @@
 #include <config.h>
 #include "protocol.h"
 
-#define VENDOR_NAME                    "ZEROPLUS"
 #define USB_INTERFACE                  0
 #define USB_CONFIGURATION              1
 #define NUM_TRIGGER_STAGES             4
@@ -210,7 +209,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(VENDOR_NAME);
+               sdi->vendor = g_strdup("ZEROPLUS");
                sdi->model = g_strdup(prof->model_name);
                sdi->serial_num = g_strdup(serial_num);
                sdi->connection_id = g_strdup(connection_id);
@@ -399,9 +398,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        case SR_CONF_SAMPLERATE:
                devc = sdi->priv;
                if (devc->prof->max_sampling_freq == 100)
-                       *data = std_gvar_samplerates(samplerates_100, ARRAY_SIZE(samplerates_100));
+                       *data = std_gvar_samplerates(ARRAY_AND_SIZE(samplerates_100));
                else if (devc->prof->max_sampling_freq == 200)
-                       *data = std_gvar_samplerates(samplerates_200, ARRAY_SIZE(samplerates_200));
+                       *data = std_gvar_samplerates(ARRAY_AND_SIZE(samplerates_200));
                else {
                        sr_err("Internal error: Unknown max. samplerate: %d.",
                               devc->prof->max_sampling_freq);
@@ -409,9 +408,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                }
                break;
        case SR_CONF_TRIGGER_MATCH:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               trigger_matches, ARRAY_SIZE(trigger_matches),
-                               sizeof(int32_t));
+               *data = std_gvar_array_i32(ARRAY_AND_SIZE(trigger_matches));
                break;
        case SR_CONF_VOLTAGE_THRESHOLD:
                *data = std_gvar_min_max_step_thresholds(-6.0, 6.0, 0.1);