mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
irq_dispatch: Add argument pointer to irq_dispatch
Provide a user defined callback context for irq's, such that when registering a callback users can provide a pointer that will get passed back when the isr is called.
This commit is contained in:
committed by
Gregory Nutt
parent
f97a99e051
commit
b3222bbc8a
+4
-4
@@ -55,7 +55,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# define irq_detach(isr) irq_attach(isr, NULL)
|
||||
# define irq_detach(isr) irq_attach(isr, NULL, NULL)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -65,7 +65,7 @@
|
||||
/* This struct defines the way the registers are stored */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef int (*xcpt_t)(int irq, FAR void *context);
|
||||
typedef int (*xcpt_t)(int irq, FAR void *context, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/* Now include architecture-specific types */
|
||||
@@ -94,11 +94,11 @@ extern "C"
|
||||
*
|
||||
* Description:
|
||||
* Configure the IRQ subsystem so that IRQ number 'irq' is dispatched to
|
||||
* 'isr'
|
||||
* 'isr' with argument 'arg'
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int irq_attach(int irq, xcpt_t isr);
|
||||
int irq_attach(int irq, xcpt_t isr, FAR void * arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: enter_critical_section
|
||||
|
||||
Reference in New Issue
Block a user