/* This function will install a interrupt service routine to a interrupt.  */
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name)
/* This function will install a interrupt service routine to a interrupt.  */
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name)
{
    rt_isr_handler_t old_handler = RT_NULL;
    if (vector < IRQ_TOTAL_NUM) {
        uint32_t cpu_ie = PICCON & BIT(0);
        PICCON &= ~BIT(0);
        old_handler = tbl_irq_vector[vector];
        tbl_irq_vector[vector] = handler;
        irq_mask |= BIT(vector);
        PICCON |= cpu_ie;
        PICPR &= ~BIT(vector);
        PICEN |= BIT(vector);
    }
    return old_handler;
}