Daniele Nicolodi wrote:
>> 2. Looks like it is not possible to setup an endless acquisition. If I
>> set .stop_src = TRIG_NONE and .stop_arg = 0, the command submission goes
>> fine, but I obtain an ENOENT error at the first a4l_sys_read(). I have
>> no idea on where to look to track down this issue.

The attached patch (against Alex git three) fixes the problem, in the
case of analog input. I haven't test the same condition for analog output.

Cheers,
-- 
Daniele

diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h
index 0e8f279..e7b2416 100644
--- a/include/analogy/buffer.h
+++ b/include/analogy/buffer.h
@@ -253,7 +253,8 @@ static inline int __abs_put(a4l_buf_t * buf, unsigned long count)
 	if ((old / buf->size) != (count / buf->size))
 		set_bit(A4L_BUF_EOBUF_NR, &buf->evt_flags);
 
-	if (count >= buf->end_count)
+	/* In the case of continuos acquisition end_count is zero */
+	if ((buf->end_count != 0) && (count >= buf->end_count))
 		set_bit(A4L_BUF_EOA_NR, &buf->evt_flags);
 
 	return 0;
@@ -303,10 +304,15 @@ static inline unsigned long __count_to_get(a4l_buf_t * buf)
 {
 	unsigned long ret;
 
-	if (buf->end_count != 0 && (buf->end_count > buf->prd_count))
+	/* In the case of continuos acquisition end_count is zero */
+	if (buf->end_count != 0) {
+		if (buf->end_count > buf->prd_count)
+			ret = buf->prd_count;
+		else
+			ret = buf->end_count;
+	} else {
 		ret = buf->prd_count;
-	else
-		ret = buf->end_count;
+	}
 
 	if (ret > buf->cns_count)
 		ret -= buf->cns_count;
_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to