Commit ce192372 authored by Miguel Gómez Sexto's avatar Miguel Gómez Sexto

tdclib: fread calls read to get one item per time.

Read can potentially gead more than 1 element per call, despite with the
current zio design thast won't happen.
But in any case, fread must call read to get one item per time, and not
n-i, so if the zio behaviour changes and read can get more than one
element, no date gets lost.
Signed-off-by: Miguel Gómez Sexto's avatarMiguel Gomez <magomez@igalia.com>
parent db896bd8
......@@ -342,7 +342,7 @@ int tdc_read(struct tdc_board *b, int chan, struct tdc_time *t,
if (j == sizeof(ctrl)) {
t[i].utc = ctrl.tstamp.secs;
t[i].ticks = ctrl.tstamp.ticks;
t[i]. bins = ctrl.tstamp.bins;
t[i].bins = ctrl.tstamp.bins;
i++;
continue;
......@@ -384,7 +384,7 @@ int tdc_fread(struct tdc_board *b, int chan, struct tdc_time *t, int n)
int i, loop;
for (i = 0; i < n; ) {
loop = tdc_read(b, chan, t + i, n - i, 0);
loop = tdc_read(b, chan, t + i, 1, 0);
if (loop < 0)
return -1;
i += loop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment