]> sigrok.org Git - libsigrok.git/blobdiff - hardware/saleae-logic/saleae-logic.c
sr: More callback param renames.
[libsigrok.git] / hardware / saleae-logic / saleae-logic.c
index 7ab68e0219f30a589853594e53cf893c424ed67f..ebe02b062d41e115c0953f938acd3e8ecb42f15c 100644 (file)
@@ -100,7 +100,7 @@ static libusb_context *usb_context = NULL;
 static int new_saleae_logic_firmware = 0;
 
 static int hw_dev_config_set(int dev_index, int hwcap, void *value);
-static int hw_dev_acquisition_stop(int dev_index, void *session_dev_id);
+static int hw_dev_acquisition_stop(int dev_index, void *cb_data);
 
 /**
  * Check the USB configuration to determine if this is a Saleae Logic.
@@ -726,7 +726,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 {
@@ -752,7 +752,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
                                         */
                                        packet.type = SR_DF_TRIGGER;
                                        packet.payload = NULL;
-                                       sr_session_send(ctx->session_data, &packet);
+                                       sr_session_send(ctx->session_dev_id, &packet);
 
                                        /*
                                         * Send the samples that triggered it, since we're
@@ -763,7 +763,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
                                        logic.length = ctx->trigger_stage;
                                        logic.unitsize = 1;
                                        logic.data = ctx->trigger_buffer;
-                                       sr_session_send(ctx->session_data, &packet);
+                                       sr_session_send(ctx->session_dev_id, &packet);
 
                                        ctx->trigger_stage = TRIGGER_FIRED;
                                        break;
@@ -795,12 +795,12 @@ static void receive_transfer(struct libusb_transfer *transfer)
                logic.length = cur_buflen - trigger_offset;
                logic.unitsize = 1;
                logic.data = cur_buf + trigger_offset;
-               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);
                }
        } else {
                /*
@@ -810,7 +810,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
        }
 }
 
-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;
@@ -824,7 +824,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("logic: %s: packet malloc failed", __func__);
@@ -868,15 +868,15 @@ static int hw_dev_acquisition_start(int dev_index, void *session_data)
        gettimeofday(&header->starttime, NULL);
        header->samplerate = ctx->cur_samplerate;
        header->num_logic_probes = ctx->profile->num_probes;
-       sr_session_send(session_data, packet);
+       sr_session_send(ctx->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 *cb_data)
 {
        struct sr_datafeed_packet packet;
 
@@ -884,7 +884,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(cb_data, &packet);
 
        receive_transfer(NULL);