- size_t new_start, new_end, new_samples,
- ring_samples;
- /*Figure out the analog data to send.
- We might need to send:
- -some or all of incoming data
- -all of incoming data and some of ring buffer
- -all of incoming data and all of ring buffer (and still might be short)
- We don't need to compare to limit_samples because pretrig_entries can never be more than limit_samples
- trigger offset indicatese where in the new samples the trigger was, but we need to go back pretrig_entries before it */
- new_start =
- (trigger_offset >
- (int) devc->pretrig_entries) ? trigger_offset
- - devc->pretrig_entries : 0;
- /*Note that we might not have gotten all the pre triggerstore data we were looking for. In such a case the sw trigger
- logic seems to fill up to the limit_samples and thus the ratio is off, but we get the full number of samples
- The number of entries in the ring buffer is pre_trigger_samples-trigger_offset so subtract that from limit samples
- as a threshold */
- new_end =
- MIN(num_slices - 1,
- devc->limit_samples -
- (pre_trigger_samples - trigger_offset) -
- 1);
- /*This includes pre and post trigger storage.*/
+
+ size_t new_start, new_end, new_samples, ring_samples;
+ /* Figure out the analog data to send. We might need to send:
+ * -some or all of incoming data
+ * -all of incoming data and some of ring buffer
+ * -all of incoming data and all of ring buffer (and still might be
+ * short)
+ * We don't need to compare to limit_samples because pretrig_entries
+ * can never be more than limit_samples trigger offset indicatese
+ * where in the new samples the trigger was, but we need to go back
+ * pretrig_entries before it */
+ new_start = (trigger_offset > (int)devc->pretrig_entries) ?
+ trigger_offset - devc->pretrig_entries : 0;
+
+ /* Note that we might not have gotten all the pre triggerstore data
+ * we were looking for. In such a case the sw trigger logic seems to
+ * fill up to the limit_samples and thus the ratio is off, but we
+ * get the full number of samples.
+ * The number of entries in the ring buffer is
+ * pre_trigger_samples-trigger_offset so subtract that from limit
+ * samples as a threshold */
+ new_end = MIN(num_slices - 1,
+ devc->limit_samples - (pre_trigger_samples - trigger_offset) - 1);
+
+ /* This includes pre and post trigger storage. */