dslogic: Merged trigger_request into dslogic_acquisition_start

This commit is contained in:
Joel Holdsworth 2017-06-15 14:54:23 -06:00 committed by Uwe Hermann
parent 4bd770f56b
commit 658caaf0d1
1 changed files with 21 additions and 32 deletions

View 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_usb_dev_inst *usb;
struct libusb_transfer *transfer;
struct dslogic_trigger_pos *tpos;
struct sr_dev_driver *di;
struct drv_context *drvc;
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
struct dslogic_trigger_pos *tpos;
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);