|
16 | 16 |
|
17 | 17 | #ifndef _ASMLANGUAGE |
18 | 18 | #include <toolchain.h> |
| 19 | +#include <zephyr/types.h> |
19 | 20 |
|
20 | 21 | #ifdef __cplusplus |
21 | 22 | extern "C" { |
@@ -49,6 +50,31 @@ extern "C" { |
49 | 50 | #define IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \ |
50 | 51 | _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) |
51 | 52 |
|
| 53 | +/** |
| 54 | + * Configure a dynamic interrupt. |
| 55 | + * |
| 56 | + * Use this instead of IRQ_CONNECT() if arguments cannot be known at build time. |
| 57 | + * |
| 58 | + * @param irq IRQ line number |
| 59 | + * @param priority Interrupt priority |
| 60 | + * @param routine Interrupt service routine |
| 61 | + * @param parameter ISR parameter |
| 62 | + * @param flags Arch-specific IRQ configuration flags |
| 63 | + * |
| 64 | + * @return The vector assigned to this interrupt |
| 65 | + */ |
| 66 | +extern int _arch_irq_connect_dynamic(unsigned int irq, unsigned int priority, |
| 67 | + void (*routine)(void *parameter), void *parameter, |
| 68 | + u32_t flags); |
| 69 | + |
| 70 | +static inline int |
| 71 | +irq_connect_dynamic(unsigned int irq, unsigned int priority, |
| 72 | + void (*routine)(void *parameter), void *parameter, |
| 73 | + u32_t flags) |
| 74 | +{ |
| 75 | + return _arch_irq_connect_dynamic(irq, priority, routine, parameter, flags); |
| 76 | +} |
| 77 | + |
52 | 78 | /** |
53 | 79 | * @brief Initialize a 'direct' interrupt handler. |
54 | 80 | * |
|
0 commit comments