From 9d22f5df352a8127043e7225755efe090ac1d4bd Mon Sep 17 00:00:00 2001 From: Mark Schulte Date: Wed, 1 Mar 2017 08:51:15 -0600 Subject: [PATCH] Add argument to timer irq callback --- arch/risc-v/src/nr5m100/nr5_timer.c | 5 ++--- arch/risc-v/src/nr5m100/nr5_timer.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/risc-v/src/nr5m100/nr5_timer.c b/arch/risc-v/src/nr5m100/nr5_timer.c index 4df3ef6755..bc4f716e5c 100644 --- a/arch/risc-v/src/nr5m100/nr5_timer.c +++ b/arch/risc-v/src/nr5m100/nr5_timer.c @@ -202,8 +202,7 @@ static void nr5_timer_setperiod(FAR struct nr5_timer_dev_s *dev, } static int nr5_timer_setisr(FAR struct nr5_timer_dev_s *dev, - int (*handler)(int irq, void *context), - int source) + xcpt_t handler, void * arg, int source) { int vectorno; @@ -275,7 +274,7 @@ static int nr5_timer_setisr(FAR struct nr5_timer_dev_s *dev, /* Otherwise set callback and enable interrupt */ - irq_attach(vectorno, handler, NULL); + irq_attach(vectorno, handler, arg); up_enable_irq(vectorno); #ifdef CONFIG_ARCH_IRQPRIO diff --git a/arch/risc-v/src/nr5m100/nr5_timer.h b/arch/risc-v/src/nr5m100/nr5_timer.h index 1c33a7e690..2a6d15c3e3 100644 --- a/arch/risc-v/src/nr5m100/nr5_timer.h +++ b/arch/risc-v/src/nr5m100/nr5_timer.h @@ -56,7 +56,7 @@ #define NR5_TIMER_SETCLOCK(d,freq) ((d)->ops->setclock(d,freq)) #define NR5_TIMER_SETPERIOD(d,period) ((d)->ops->setperiod(d,period)) #define NR5_TIMER_SETCOMPARE(d,ch,comp) ((d)->ops->setcompare(d,ch,comp)) -#define NR5_TIMER_SETISR(d,hnd,s) ((d)->ops->setisr(d,hnd,s)) +#define NR5_TIMER_SETISR(d,hnd,arg,s) ((d)->ops->setisr(d,hnd,arg,s)) #define NR5_TIMER_ENABLEINT(d,s) ((d)->ops->enableint(d,s)) #define NR5_TIMER_DISABLEINT(d,s) ((d)->ops->disableint(d,s)) #define NR5_TIMER_ACKINT(d,s) ((d)->ops->ackint(d,s)) @@ -112,7 +112,7 @@ struct nr5_timer_ops_s /* Timer Interrupt Operations */ - int (*setisr)(FAR struct nr5_timer_dev_s *dev, int (*handler)(int irq, void *context), int source); + int (*setisr)(FAR struct nr5_timer_dev_s *dev, xcpt_t handler, void *arg, int source); void (*enableint)(FAR struct nr5_timer_dev_s *dev, int source); void (*disableint)(FAR struct nr5_timer_dev_s *dev, int source); void (*ackint)(FAR struct nr5_timer_dev_s *dev, int source);