]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
sr_dev_inst_new(): Use NULL (not "") if version unknown/nonexisting.
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index 932de635683fcf52468334f1bea9e291ab981ee4..dbd4ddf941e44ed2af94a2e3bd13b0dd330faa13 100644 (file)
@@ -36,9 +36,8 @@
 #define USB_DESCRIPTION                        "ASIX SIGMA"
 #define USB_VENDOR_NAME                        "ASIX"
 #define USB_MODEL_NAME                 "SIGMA"
-#define USB_MODEL_VERSION              ""
 #define TRIGGER_TYPE                   "rf10"
-#define NUM_PROBES                     16
+#define NUM_CHANNELS                   16
 
 SR_PRIV struct sr_dev_driver asix_sigma_driver_info;
 static struct sr_dev_driver *di = &asix_sigma_driver_info;
@@ -62,7 +61,7 @@ static const uint64_t samplerates[] = {
  * http://tools.asix.net/img/sigma_sigmacab_pins_720.jpg
  * (the cable has two additional GND pins, and a TI and TO pin)
  */
-static const char *channel_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_CHANNELS + 1] = {
        "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15", "16",
        NULL,
@@ -71,6 +70,7 @@ static const char *channel_names[NUM_PROBES + 1] = {
 static const int32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
+       SR_CONF_TRIGGER_TYPE,
        SR_CONF_CAPTURE_RATIO,
        SR_CONF_LIMIT_MSEC,
 };
@@ -457,14 +457,14 @@ static GSList *scan(GSList *options)
 
        /* Register SIGMA device. */
        if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME,
-                                   USB_MODEL_NAME, USB_MODEL_VERSION))) {
+                                   USB_MODEL_NAME, NULL))) {
                sr_err("%s: sdi was NULL", __func__);
                goto free;
        }
        sdi->driver = di;
 
        for (i = 0; channel_names[i]; i++) {
-               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                channel_names[i])))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);