mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
uniform code writing-disable interrupt
This commit is contained in:
@@ -77,7 +77,7 @@ void uic_interrupt(rt_uint32_t uic_base, int vec_base)
|
||||
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handler,
|
||||
void* param, const char* name)
|
||||
{
|
||||
int intVal;
|
||||
rt_base_t level;
|
||||
rt_isr_handler_t old_handler;
|
||||
|
||||
if (((int)vector < 0) || ((int) vector >= MAX_HANDLERS))
|
||||
@@ -86,13 +86,13 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handle
|
||||
}
|
||||
|
||||
/* install the handler in the system interrupt table */
|
||||
intVal = rt_hw_interrupt_disable (); /* lock interrupts to prevent races */
|
||||
level = rt_hw_interrupt_disable(); /* lock interrupts to prevent races */
|
||||
|
||||
old_handler = isr_table[vector].handler;
|
||||
isr_table[vector].handler = new_handler;
|
||||
isr_table[vector].param = param;
|
||||
|
||||
rt_hw_interrupt_enable (intVal);
|
||||
rt_hw_interrupt_enable(level);
|
||||
}
|
||||
|
||||
void rt_hw_interrupt_mask(int vector)
|
||||
|
||||
Reference in New Issue
Block a user