Commit a35b2831 authored by Miguel Gómez Sexto's avatar Miguel Gómez Sexto Committed by Samuel Iglesias Gonsálvez

Clarify time and timestamps thresholds values. Check that timestamps threshold maximum value.

Signed-off-by: Miguel Gómez Sexto's avatarMiguel Gomez <magomez@igalia.com>
Signed-off-by: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
parent d5c23101
......@@ -255,6 +255,11 @@ int tdc_get_time_threshold(struct tdc_board *b, uint32_t *thres)
int tdc_set_timestamp_threshold(struct tdc_board *b, uint32_t thres)
{
if (thres > 64) {
errno = EINVAL;
return -1;
}
return __tdc_sysfs_set(b, "tstamp_thresh", thres * 2);
}
......
......@@ -198,7 +198,8 @@ extern int tdc_get_dac_word(struct tdc_board *b, uint32_t *dw);
* @brief Set time threshold
*
* The time threshold is the maximum time we will not have an IRQ if there is no
* enough number of events acquired (configured by timestamp threshold).
* enough number of events acquired (configured by timestamp threshold). This
* value must be a 32 bits positive value.
*
* It doens't means that we have always pending events.
*
......@@ -232,6 +233,7 @@ extern int tdc_get_time_threshold(struct tdc_board *b, uint32_t *thres);
* @brief Set timestamp threshold
*
* The timestamp threshold is the number of events we want per interrupt.
* The value must be between 0 and 64.
*
* @param b - pointer to struct tdc_board
* @param thres - Timestamp threshold, in seconds.
......
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