Commit ede2d0c5 authored by Federico Vaga's avatar Federico Vaga

lib: fix library to be consistent with doc on error

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent d1165f23
......@@ -158,11 +158,15 @@ int fdelay_config_pulse(struct fdelay_board *userb,
therefore we temporarily have to check the output programming correctness in the user library. */
if (mode == FD_OUT_MODE_DELAY || mode == FD_OUT_MODE_DISABLED)
{
if(pulse->rep < 0 || pulse->rep > 16) /* delay mode allows trains of 1 to 16 pulses. */
return -EINVAL;
if(pulse->rep < 0 || pulse->rep > 16) { /* delay mode allows trains of 1 to 16 pulses. */
errno = EINVAL;
return -1;
}
if(a[FD_ATTR_OUT_START_L] == 0 && a[FD_ATTR_OUT_START_COARSE] < (600 / 8)) // 600 ns min delay
return -EINVAL;
if(a[FD_ATTR_OUT_START_L] == 0 && a[FD_ATTR_OUT_START_COARSE] < (600 / 8)) { // 600 ns min delay
errno = EINVAL;
return -1;
}
}
/* we need to fill the nsample field of the control */
......
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