tdc/lib: reset acam chip on the library automatically.

Put a limit of 10 tries. If after 10 tries we still have not ready the chip,
we abort and notify the user.
Signed-off-by: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
parent 082475f3
......@@ -198,7 +198,17 @@ void tdc_free(struct tdc_time *buffer)
int tdc_start_acquisition(struct tdc_board *b)
{
return __tdc_sysfs_set(b, "activate_acquisition", 1);
int ret, tries = 0;
do {
ret = __tdc_sysfs_set(b, "activate_acquisition", 1);
if (ret) {
__tdc_sysfs_set(b, "reset_acam", 1);
tries++;
}
} while ((ret !=0) && (tries < 10));
return ret;
}
int tdc_stop_acquisition(struct tdc_board *b)
......
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