[subexp-daq] SIS3316 implementation in NURDLIB fixed
Håkan T Johansson
f96hajo at chalmers.se
Fri Mar 22 17:37:42 CET 2024
Dear Günter,
just had a quick look:
This old code with +1 is surely not good:
bytes_to_read =
((a_words_to_read * sizeof(uint32_t)) + 1) & ~0x7;
Since sizeof(uint32_t) is 4, the addition of 1 would not have any effect.
However, I'm a bit wondering about addint 8 (and 16 in the case of ~0xf).
How about the following:
bytes_to_read =
((a_words_to_read * sizeof(uint32_t)) + 0x7) & ~0x7;
(and '+ 0xf' with '& ~0xf') ?
That ought to bring it up to the next boundary if the read count was
unaligned. And the if-statements would not be needed.
Cheers,
Håkan
On Fri, 22 Mar 2024, Weber, Guenter Dr. wrote:
>
> Dear friends,
>
>
> we just pushed a fixed version of the SIS3316 implementation. Compared to
> the original version of REBASING_SIS3316 a lot of glitches in the code were
> fixed in a first run a few days ago and now we finally also fixed a
> long-standing problem with the readout of the averaged traces.
>
>
>
>
>
> Best greetings and have a nice weekend everybody
>
> Günter
>
>
>
>
>
>
More information about the subexp-daq
mailing list