]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Make sure to always send SR_DF_END at end of capture.
authorMartin Ling <redacted>
Wed, 15 Jan 2014 17:06:46 +0000 (17:06 +0000)
committerUwe Hermann <redacted>
Fri, 17 Jan 2014 00:52:29 +0000 (01:52 +0100)
hardware/rigol-ds/api.c
hardware/rigol-ds/protocol.c

index 02abae9bfb5f1a20797d12f19f876ff2028b0826..d610187428d04426c004786834b5372da92fd4fd 100644 (file)
@@ -891,6 +891,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
 {
        struct dev_context *devc;
        struct sr_scpi_dev_inst *scpi;
+       struct sr_datafeed_packet packet;
 
        (void)cb_data;
 
@@ -901,6 +902,10 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR;
        }
 
+       /* End of last frame. */
+       packet.type = SR_DF_END;
+       sr_session_send(sdi, &packet);
+
        g_slist_free(devc->enabled_analog_probes);
        g_slist_free(devc->enabled_digital_probes);
        devc->enabled_analog_probes = NULL;
index 5ede6d7cab562e081226d65b622bca38a54c2f40..69bb151ee2169e381e133845c2d2d9b24a4043a9 100644 (file)
@@ -590,9 +590,6 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                                devc->channel_entry = devc->enabled_digital_probes;
                                rigol_ds_channel_start(sdi);
                        } else if (++devc->num_frames == devc->limit_frames) {
-                               /* End of last frame. */
-                               packet.type = SR_DF_END;
-                               sr_session_send(sdi, &packet);
                                sdi->driver->dev_acquisition_stop(sdi, cb_data);
                        } else {
                                /* Get the next frame, starting with the first analog channel. */