Commit 52511df5 authored by Jorge Machado's avatar Jorge Machado

Create global_user_arguments to allow exit procedure to disable the pulse train generation

parent 30d1ac9c
......@@ -29,6 +29,8 @@
/* Static data for signal handlers */
static fmc_dio_device global_fmc_dev = NULL;
/* Global user arguments */
static user_args global_user_arguments = NULL;
/* Global verbose control */
static int verbose_mode = 0;
......@@ -82,6 +84,7 @@ int main(int argc, char *argv[])
ret = 1;
goto out_log;
}
global_user_arguments = user_arguments;
/* Set verbose mode from user command line */
verbose_mode = user_arguments->verbose;
......@@ -298,7 +301,7 @@ static void set_stdin_as_nonblocking(void)
static void exit_abruptly(int sig)
{
setup_fmc_dio_device_irq(global_fmc_dev, 1000000, 0);
setup_fmc_dio_device_irq(global_fmc_dev, global_user_arguments->irq_period, 0);
sleep(1);
disable_fmc_dio_device_all_irq(global_fmc_dev);
exit(0);
......
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