From: Joel Holdsworth Date: Thu, 15 Jun 2017 20:54:23 +0000 (-0600) Subject: dslogic: Merged trigger_request into dslogic_acquisition_start X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=658caaf0d17cd660ad70c509b3292bc6ac6879a0;p=libsigrok.git dslogic: Merged trigger_request into dslogic_acquisition_start --- diff --git a/src/hardware/dslogic/protocol.c b/src/hardware/dslogic/protocol.c index 4bfac70a..8a1aa7a7 100644 --- a/src/hardware/dslogic/protocol.c +++ b/src/hardware/dslogic/protocol.c @@ -988,16 +988,32 @@ static void LIBUSB_CALL trigger_receive(struct libusb_transfer *transfer) libusb_free_transfer(transfer); } -static int trigger_request(const struct sr_dev_inst *sdi) +SR_PRIV int dslogic_acquisition_start(const struct sr_dev_inst *sdi) { + struct sr_dev_driver *di; + struct drv_context *drvc; + struct dev_context *devc; struct sr_usb_dev_inst *usb; - struct libusb_transfer *transfer; struct dslogic_trigger_pos *tpos; - struct dev_context *devc; + struct libusb_transfer *transfer; + int timeout; int ret; - usb = sdi->conn; + if (sdi->status != SR_ST_ACTIVE) + return SR_ERR_DEV_CLOSED; + + di = sdi->driver; + drvc = di->context; devc = sdi->priv; + usb = sdi->conn; + + devc->ctx = drvc->sr_ctx; + devc->sent_samples = 0; + devc->empty_transfer_count = 0; + devc->acq_aborted = FALSE; + + timeout = get_timeout(devc); + usb_source_add(sdi->session, devc->ctx, timeout, receive_data, drvc); if ((ret = command_stop_acquisition(sdi)) != SR_OK) return ret; @@ -1033,33 +1049,6 @@ static int trigger_request(const struct sr_dev_inst *sdi) return ret; } -SR_PRIV int dslogic_acquisition_start(const struct sr_dev_inst *sdi) -{ - struct sr_dev_driver *di; - struct drv_context *drvc; - struct dev_context *devc; - int timeout; - - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - - di = sdi->driver; - drvc = di->context; - devc = sdi->priv; - - devc->ctx = drvc->sr_ctx; - devc->sent_samples = 0; - devc->empty_transfer_count = 0; - devc->acq_aborted = FALSE; - - timeout = get_timeout(devc); - usb_source_add(sdi->session, devc->ctx, timeout, receive_data, drvc); - - trigger_request(sdi); - - return SR_OK; -} - SR_PRIV int dslogic_acquisition_stop(struct sr_dev_inst *sdi) { command_stop_acquisition(sdi);