Module: xenomai-2.5
Branch: master
Commit: 527ed184265ba494c080af940b099bb537c0e9fe
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=527ed184265ba494c080af940b099bb537c0e9fe

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sat Feb  6 23:03:05 2010 +0100

analogy: reinitialize events flags before accepting commands

---

 ksrc/drivers/analogy/transfer.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c
index 6345589..b2c91bd 100644
--- a/ksrc/drivers/analogy/transfer.c
+++ b/ksrc/drivers/analogy/transfer.c
@@ -232,14 +232,17 @@ int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd)
        /* Sets the working command */
        dev->transfer.bufs[cmd->idx_subd]->cur_cmd = cmd;
 
-       /* Initializes the counts and the flag variable */
+       /* Initializes the counts */
        dev->transfer.bufs[cmd->idx_subd]->end_count = 0;
        dev->transfer.bufs[cmd->idx_subd]->prd_count = 0;
        dev->transfer.bufs[cmd->idx_subd]->cns_count = 0;
        dev->transfer.bufs[cmd->idx_subd]->tmp_count = 0;
-       dev->transfer.bufs[cmd->idx_subd]->evt_flags = 0;
        dev->transfer.bufs[cmd->idx_subd]->mng_count = 0;
 
+       /* Flush pending events */
+       dev->transfer.bufs[cmd->idx_subd]->evt_flags = 0;
+       a4l_flush_sync(&dev->transfer.bufs[cmd->idx_subd]->sync);
+
        /* Computes the count to reach, if need be */
        if (cmd->stop_src == TRIG_COUNT) {
                for (i = 0; i < cmd->nb_chan; i++) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to