File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/hardware/openbench-logic-sniffer Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -593,11 +593,12 @@ SR_PRIV int ols_prepare_acquisition(const struct sr_dev_inst *sdi) {
593593 }
594594
595595 /*
596- * Limit readcount to prevent reading past the end of the hardware
597- * buffer. Rather read too many samples than too few .
596+ * Limit the number of samples to what the hardware can do.
597+ * The sample count is always a multiple of four .
598598 */
599- uint32_t samplecount = MIN (devc -> max_samples / num_changroups , devc -> limit_samples );
600- uint32_t readcount = (samplecount + 3 ) / 4 ;
599+ devc -> limit_samples =
600+ (MIN (devc -> max_samples / num_changroups , devc -> limit_samples ) + 3 ) / 4 * 4 ;
601+ uint32_t readcount = devc -> limit_samples / 4 ;
601602 uint32_t delaycount ;
602603
603604 /* Basic triggers. */
You can’t perform that action at this time.
0 commit comments