Commit 2b7ec587 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

irq-demo: Wait for a while before flushing FMC DIO channel

parent 572a47a7
......@@ -26,6 +26,8 @@
#include "fmc-dio-device.h"
#include "fmc-dio-device-private.h"
#define FMC_DIO_FLUSH_SLEEP 5
fmc_dio_device create_fmc_dio_device(char *name)
{
fmc_dio_device dev = calloc(1, sizeof(*dev));
......@@ -298,10 +300,14 @@ void flush_fmc_dio_device_channel(fmc_dio_device dev, int ch)
struct usr_timestamp *ts;
unsigned int nts;
LOG(dev, "Flushing FMC DIO device, channel %d... ", ch);
sleep(FMC_DIO_FLUSH_SLEEP);
ret = get_hw_ts_from_fmc_dio_device(dev, ch, &ts, &nts);
if(ret == 0) {
free(ts);
}
LOG(dev, "Ok!\n");
}
static int get_kernel_leaps_info(fmc_dio_device dev)
......
......@@ -118,13 +118,13 @@ int main(int argc, char *argv[])
/* Before starting IRQ demo, Interrupts should be properly configured:
* 1) Disable all interrupts
* 2) Flush TEST_FMC_DIO_CH channel
* 3) Enable the TEST_FMC_DIO_CH interrupt line
* 2) Enable the TEST_FMC_DIO_CH interrupt line
* 3) Flush TEST_FMC_DIO_CH channel
* 4) Setup specific information for interrupt line (period from user arguments or default one)
*/
disable_fmc_dio_device_all_irq(dev);
flush_fmc_dio_device_channel(dev, TEST_FMC_DIO_CH);
enable_fmc_dio_device_irq(dev, TEST_FMC_DIO_CH);
flush_fmc_dio_device_channel(dev, TEST_FMC_DIO_CH);
setup_fmc_dio_device_irq(dev, user_arguments->irq_period, TEST_FMC_DIO_COUNT);
/* Configure stdin as non-blocking. It is required for the user check exit function */
......
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