]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
soft-trigger: Add support for pre-triggering.
[libsigrok.git] / src / hardware / fx2lafw / api.c
index 38ca70ff0dd755067985d9fd782178870cee0a5a..796749a34dbd0d3f004c7111654b6aa4e604f77f 100644 (file)
@@ -241,7 +241,7 @@ static GSList *scan(GSList *options)
                if (!prof)
                        continue;
 
-               sdi = sr_dev_inst_new();
+               sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INITIALIZING;
                sdi->vendor = g_strdup(prof->vendor);
                sdi->model = g_strdup(prof->model);
@@ -253,9 +253,8 @@ static GSList *scan(GSList *options)
                /* Fill in channellist according to this device's profile. */
                num_logic_channels = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8;
                for (j = 0; j < num_logic_channels; j++) {
-                       if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
-                                       channel_names[j])))
-                               return NULL;
+                       ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
+                                       channel_names[j]);
                        sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
@@ -568,7 +567,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        devc->empty_transfer_count = 0;
 
        if ((trigger = sr_session_trigger_get(sdi->session))) {
-               devc->stl = soft_trigger_logic_new(sdi, trigger);
+               devc->stl = soft_trigger_logic_new(sdi, trigger, 0);
                devc->trigger_fired = FALSE;
        } else
                devc->trigger_fired = TRUE;