X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Ffx2lafw.c;h=c40285aba4a95c2a4af8a2eced69bf603d471573;hb=3cd3a20b350ed1e86675aee067f60ac5a2f576b1;hp=cc2ce0d450acc11fd0421e1ab415a6d1499ba3bb;hpb=1f9813eb6cf2fa3b6511af46b19270feb9484c1e;p=libsigrok.git diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index cc2ce0d4..c40285ab 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -552,7 +552,7 @@ static void receive_transfer(struct libusb_transfer *transfer) * The FX2 gave up. End the acquisition, the frontend * will work out that the samplecount is short. */ - hw_dev_acquisition_stop(-1, ctx->session_data); + hw_dev_acquisition_stop(-1, ctx->session_dev_id); } return; } else { @@ -565,17 +565,17 @@ static void receive_transfer(struct libusb_transfer *transfer) logic.length = cur_buflen; logic.unitsize = 1; logic.data = cur_buf; - sr_session_send(ctx->session_data, &packet); + sr_session_send(ctx->session_dev_id, &packet); g_free(cur_buf); num_samples += cur_buflen; if (ctx->limit_samples && (unsigned int) num_samples > ctx->limit_samples) { - hw_dev_acquisition_stop(-1, ctx->session_data); + hw_dev_acquisition_stop(-1, ctx->session_dev_id); } } -static int hw_dev_acquisition_start(int dev_index, void *session_data) +static int hw_dev_acquisition_start(int dev_index, void *cb_data) { struct sr_dev_inst *sdi; struct sr_datafeed_packet *packet; @@ -589,7 +589,7 @@ static int hw_dev_acquisition_start(int dev_index, void *session_data) if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) return SR_ERR; ctx = sdi->priv; - ctx->session_data = session_data; + ctx->session_dev_id = cb_data; if (!(packet = g_try_malloc(sizeof(struct sr_datafeed_packet)))) { sr_err("fx2lafw: %s: packet malloc failed", __func__); @@ -633,15 +633,15 @@ static int hw_dev_acquisition_start(int dev_index, void *session_data) gettimeofday(&header->starttime, NULL); header->samplerate = 24000000UL; header->num_logic_probes = ctx->profile->num_probes; - sr_session_send(session_data, packet); + sr_session_send(session_dev_id, packet); g_free(header); g_free(packet); return SR_OK; } -/* This stops acquisition on ALL devices, ignoring dev_index. */ -static int hw_dev_acquisition_stop(int dev_index, void *session_data) +/* TODO: This stops acquisition on ALL devices, ignoring dev_index. */ +static int hw_dev_acquisition_stop(int dev_index, void *session_dev_id) { struct sr_datafeed_packet packet; @@ -649,7 +649,7 @@ static int hw_dev_acquisition_stop(int dev_index, void *session_data) (void)dev_index; packet.type = SR_DF_END; - sr_session_send(session_data, &packet); + sr_session_send(session_dev_id, &packet); receive_transfer(NULL);