remain the old handler to keep forward compatibility
This commit is contained in:
parent
9678ee67e9
commit
7917cf09e7
|
@ -41,9 +41,10 @@ rt_uint8_t *rt_hw_stack_init(void *entry,
|
|||
void rt_hw_interrupt_init(void);
|
||||
void rt_hw_interrupt_mask(int vector);
|
||||
void rt_hw_interrupt_umask(int vector);
|
||||
void rt_hw_interrupt_install(int vector,
|
||||
rt_isr_handler_t rt_hw_interrupt_install(int vector,
|
||||
rt_isr_handler_t handler,
|
||||
void *param, char *name);
|
||||
void *param,
|
||||
char *name);
|
||||
void rt_hw_interrupt_handle(int vector);
|
||||
|
||||
rt_base_t rt_hw_interrupt_disable(void);
|
||||
|
|
|
@ -427,6 +427,14 @@ void rt_module_unload_sethook(void (*hook)(rt_module_t module));
|
|||
*/
|
||||
typedef void (*rt_isr_handler_t)(int vector, void *param);
|
||||
|
||||
struct rt_irq_desc {
|
||||
char irq_name[RT_NAME_MAX];
|
||||
rt_isr_handler_t isr_handle;
|
||||
void *param;
|
||||
rt_uint32_t interrupt_cnt;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* rt_interrupt_enter and rt_interrupt_leave only can be called by BSP
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include <rtthread.h>
|
||||
#include "at91sam926x.h"
|
||||
#include "interrupt.h"
|
||||
|
||||
#define MAX_HANDLERS (AIC_IRQS + PIN_IRQS)
|
||||
|
||||
|
@ -308,17 +307,26 @@ void rt_hw_interrupt_umask(int irq)
|
|||
* @param handler the interrupt service routine to be installed
|
||||
* @param param the interrupt service function parameter
|
||||
* @param name the interrupt name
|
||||
* @return old handler
|
||||
*/
|
||||
void rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
|
||||
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
|
||||
void *param, char *name)
|
||||
{
|
||||
rt_isr_handler_t old_handler = RT_NULL;
|
||||
|
||||
if(vector < MAX_HANDLERS)
|
||||
{
|
||||
old_handler = irq_desc[vector].isr_handle;
|
||||
if (handler != RT_NULL)
|
||||
{
|
||||
rt_snprintf(irq_desc[vector].irq_name, RT_NAME_MAX - 1, "%s", name);
|
||||
irq_desc[vector].isr_handle = (rt_isr_handler_t)handler;
|
||||
irq_desc[vector].param = param;
|
||||
irq_desc[vector].interrupt_cnt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return old_handler;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef __INTERRUPT_H__
|
||||
#define __INTERRUPT_H__
|
||||
|
||||
struct rt_irq_desc {
|
||||
char irq_name[RT_NAME_MAX];
|
||||
rt_isr_handler_t isr_handle;
|
||||
void *param;
|
||||
rt_uint32_t interrupt_cnt;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -16,7 +16,6 @@
|
|||
#include <rthw.h>
|
||||
|
||||
#include "at91sam926x.h"
|
||||
#include "interrupt.h"
|
||||
|
||||
/**
|
||||
* @addtogroup AT91SAM926X
|
||||
|
|
Loading…
Reference in New Issue