]> sigrok.org Git - libsigrok.git/commitdiff
dslogic: Removed trigger_fired option
authorJoel Holdsworth <redacted>
Thu, 15 Jun 2017 20:52:28 +0000 (14:52 -0600)
committerUwe Hermann <redacted>
Mon, 19 Jun 2017 22:18:16 +0000 (00:18 +0200)
src/hardware/dslogic/protocol.c
src/hardware/dslogic/protocol.h

index 8a1aa7a75e4f4920d8e7b351e07e089dfc513208..3606472ec42a41a251001bdedbb5cf1d72ff9647 100644 (file)
@@ -800,37 +800,36 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
        } else {
                devc->empty_transfer_count = 0;
        }
-       if (devc->trigger_fired) {
-               if (!devc->limit_samples || devc->sent_samples < devc->limit_samples) {
-                       /* Send the incoming transfer to the session bus. */
-                       if (devc->limit_samples && devc->sent_samples + cur_sample_count > devc->limit_samples)
-                               num_samples = devc->limit_samples - devc->sent_samples;
-                       else
-                               num_samples = cur_sample_count;
-
-                       if (devc->trigger_pos > devc->sent_samples
-                               && devc->trigger_pos <= devc->sent_samples + num_samples) {
-                                       /* DSLogic trigger in this block. Send trigger position. */
-                                       trigger_offset = devc->trigger_pos - devc->sent_samples;
-                                       /* Pre-trigger samples. */
-                                       send_data(sdi, (uint8_t *)transfer->buffer,
-                                               trigger_offset * unitsize, unitsize);
-                                       devc->sent_samples += trigger_offset;
-                                       /* Trigger position. */
-                                       devc->trigger_pos = 0;
-                                       packet.type = SR_DF_TRIGGER;
-                                       packet.payload = NULL;
-                                       sr_session_send(sdi, &packet);
-                                       /* Post trigger samples. */
-                                       num_samples -= trigger_offset;
-                                       send_data(sdi, (uint8_t *)transfer->buffer
-                                                       + trigger_offset * unitsize, num_samples * unitsize, unitsize);
-                                       devc->sent_samples += num_samples;
-                       } else {
-                               send_data(sdi, (uint8_t *)transfer->buffer,
-                                       num_samples * unitsize, unitsize);
-                               devc->sent_samples += num_samples;
-                       }
+
+       if (!devc->limit_samples || devc->sent_samples < devc->limit_samples) {
+               /* Send the incoming transfer to the session bus. */
+               if (devc->limit_samples && devc->sent_samples + cur_sample_count > devc->limit_samples)
+                       num_samples = devc->limit_samples - devc->sent_samples;
+               else
+                       num_samples = cur_sample_count;
+
+               if (devc->trigger_pos > devc->sent_samples
+                       && devc->trigger_pos <= devc->sent_samples + num_samples) {
+                       /* DSLogic trigger in this block. Send trigger position. */
+                       trigger_offset = devc->trigger_pos - devc->sent_samples;
+                       /* Pre-trigger samples. */
+                       send_data(sdi, (uint8_t *)transfer->buffer,
+                               trigger_offset * unitsize, unitsize);
+                       devc->sent_samples += trigger_offset;
+                       /* Trigger position. */
+                       devc->trigger_pos = 0;
+                       packet.type = SR_DF_TRIGGER;
+                       packet.payload = NULL;
+                       sr_session_send(sdi, &packet);
+                       /* Post trigger samples. */
+                       num_samples -= trigger_offset;
+                       send_data(sdi, (uint8_t *)transfer->buffer
+                                       + trigger_offset * unitsize, num_samples * unitsize, unitsize);
+                       devc->sent_samples += num_samples;
+               } else {
+                       send_data(sdi, (uint8_t *)transfer->buffer,
+                               num_samples * unitsize, unitsize);
+                       devc->sent_samples += num_samples;
                }
        }
 
@@ -912,7 +911,6 @@ static int start_transfers(const struct sr_dev_inst *sdi)
        devc->sent_samples = 0;
        devc->acq_aborted = FALSE;
        devc->empty_transfer_count = 0;
-       devc->trigger_fired = TRUE;
 
        num_transfers = get_number_of_transfers(devc);
 
index 23c1d507fb999088cc90cef82339c0eb125263e1..e10c22369bce0c497e42dad64ce54528436cd46c 100644 (file)
@@ -122,7 +122,6 @@ struct dev_context {
        uint64_t capture_ratio;
 
        /* Operational settings */
-       gboolean trigger_fired;
        gboolean acq_aborted;
 
        unsigned int sent_samples;