[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Timer Interrupt



Hello, 

I have to execute a function every 10 ms and tried to register the
function for the timer interrupt. I added the code below to the
gpio-driver, but my counter does not increase and the debug message is
not written out to COM2.   

Does anyone know, what I am doing wrong? Is it the right way to call a
function every 10 ms on the Dev.Board or is there a better solution?

Thanks for your help

Claudius


(I am still using kernel-2.4.3, Cris compiler 1.11 and Devboard_lx
1.0.0) 

______________________________________________

static int TimerIntrpt = 0;

static void spi_intrpt(void *);

static struct tq_struct Task = {
        NULL,
        0,
        spi_intrpt,
        NULL
};

static void spi_intrpt(void *irrelevant)
{

   TimerIntrpt++;
// sampled_value = read_a_d(...);
   if (TimerIntrpt = 100) 
      printk("**** couter = 100 ****\n");
   queue_task(&Task, &tq_timer);
}


static int
gpio_open(struct inode *inode, struct file *filp)
{
   ...
   ...

   /* registering function */
   queue_task(&Task, &tq_timer);

   return 0;
}

_______________________________________________