/* Registers a function to be called when an interrupt occurs. */
void IntRegister(unsigned long ulInterrupt, void(*pfnHandler)(void))
/* Registers a function to be called when an interrupt occurs. */
void IntRegister(unsigned long ulInterrupt, void(*pfnHandler)(void))
{
    unsigned long *ulNvicTbl;
    ASSERT(ulInterrupt < NUM_INTERRUPTS);
    ulNvicTbl = (unsigned long *)HWREG(NVIC_VTABLE);
    ulNvicTbl[ulInterrupt]= (unsigned long)pfnHandler;
}