X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=hardware%2Ffx2lafw%2Fapi.c;h=3242afcead486cb01dc4a7490d37101f6f4a4871;hp=a3e67614f26271a8a8bbac19c59509d61b0940ee;hb=43cd4637285833706f8a404ca027bcf0ee75b9ae;hpb=9615eeb572be5db9e770c0e343f80ab212335e3f diff --git a/hardware/fx2lafw/api.c b/hardware/fx2lafw/api.c index a3e67614..3242afce 100644 --- a/hardware/fx2lafw/api.c +++ b/hardware/fx2lafw/api.c @@ -96,6 +96,9 @@ static const char *channel_names[] = { static const int32_t soft_trigger_matches[] = { SR_TRIGGER_ZERO, SR_TRIGGER_ONE, + SR_TRIGGER_RISING, + SR_TRIGGER_FALLING, + SR_TRIGGER_EDGE, }; static const uint64_t samplerates[] = { @@ -513,6 +516,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) struct dev_context *devc; struct drv_context *drvc; struct sr_usb_dev_inst *usb; + struct sr_trigger *trigger; struct libusb_transfer *transfer; unsigned int i, timeout, num_transfers; int ret; @@ -531,10 +535,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc->acq_aborted = FALSE; devc->empty_transfer_count = 0; - if (sr_session_trigger_get()) { + if ((trigger = sr_session_trigger_get(sdi->session))) { + devc->stl = soft_trigger_logic_new(sdi, trigger); devc->trigger_fired = FALSE; - devc->cur_trigger_stage = 0; - devc->cur_trigger_step = 0; } else devc->trigger_fired = TRUE; @@ -573,7 +576,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc->ctx = drvc->sr_ctx; - usb_source_add(devc->ctx, timeout, receive_data, NULL); + usb_source_add(sdi->session, devc->ctx, timeout, receive_data, NULL); /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX);