]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: comedi_test: change end-of-acquisition test
authorIan Abbott <abbotti@mev.co.uk>
Fri, 4 Jan 2013 11:33:23 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:37:12 +0000 (14:37 -0800)
commit09d2bfa2f933d59bfc7207c60d6c6cc9b86a689e
tree737a67bc1b6d22780228d2a8704186a6d605a449
parentb18b8a23055e60177e61511ad5f56d8e738acfdc
staging: comedi: comedi_test: change end-of-acquisition test

In the "comedi_test" module's acquisition timer function
`waveform_ai_interrupt()`, move the code for ending the acquisition
outside the scan loop.  Determine if the number of scans to be done is
sufficient to end the acquisition before entering the scan loop.  On
leaving the scan loop, set the `COMEDI_CB_EOA` event if the acquisition
is ending.  Only reschedule the timer if the acquisition is not ending.

Remove the somewhat useless `timer_running` flag from the private data.
This was intended to stop the timer function adding the timer back on
the timer queue periodically, but the flag setting wasn't synchronized
with the timer and we already use `del_timer_sync()` to synchronize
removal from the queue.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/comedi_test.c