File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/hardware/openbench-logic-sniffer Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,7 @@ ols_set_basic_trigger_stage(const struct ols_basic_trigger_desc *trigger_desc,
628628SR_PRIV int ols_prepare_acquisition (const struct sr_dev_inst * sdi )
629629{
630630 int ret ;
631+ uint32_t readcount , delaycount ;
631632
632633 struct dev_context * devc = sdi -> priv ;
633634 struct sr_serial_dev_inst * serial = sdi -> conn ;
@@ -643,13 +644,13 @@ SR_PRIV int ols_prepare_acquisition(const struct sr_dev_inst *sdi)
643644 }
644645
645646 /*
646- * Limit readcount to prevent reading past the end of the hardware
647- * buffer. Rather read too many samples than too few .
647+ * Limit the number of samples to what the hardware can do.
648+ * The sample count is always a multiple of four .
648649 */
649- uint32_t samplecount =
650- MIN (devc -> max_samples / num_changroups , devc -> limit_samples );
651- uint32_t readcount = ( samplecount + 3 ) / 4 ;
652- uint32_t delaycount ;
650+ devc -> limit_samples =
651+ ( MIN (devc -> max_samples / num_changroups , devc -> limit_samples ) + 3 )
652+ / 4 * 4 ;
653+ readcount = devc -> limit_samples / 4 ;
653654
654655 /* Basic triggers. */
655656 struct ols_basic_trigger_desc basic_trigger_desc ;
You can’t perform that action at this time.
0 commit comments