]> sigrok.org Git - libsigrok.git/commitdiff
dslogic: Merged trigger_request into dslogic_acquisition_start
authorJoel Holdsworth <redacted>
Thu, 15 Jun 2017 20:54:23 +0000 (14:54 -0600)
committerUwe Hermann <redacted>
Mon, 19 Jun 2017 22:18:16 +0000 (00:18 +0200)
src/hardware/dslogic/protocol.c

index 4bfac70a74396c100d612f2c4677fb4c4893f34c..8a1aa7a75e4f4920d8e7b351e07e089dfc513208 100644 (file)
@@ -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);