- id = Os_Sys.isrCnt++;\r
- Os_IsrVarList[id].constPtr = isrPtr;\r
- Os_VectorToIsr[isrPtr->vector + IRQ_INTERRUPT_OFFSET ] = id;\r
- Irq_EnableVector( isrPtr->vector, isrPtr->priority, Os_ApplGetCore(isrPtr->appOwner ) );\r
+ /* Check if we already have installed it */\r
+ installedId = Os_VectorToIsr[isrPtr->vector + IRQ_INTERRUPT_OFFSET ];\r
+\r
+ if( installedId != ILL_VECTOR ) {\r
+ /* The vector is already installed */\r
+ id = installedId;\r
+ } else {\r
+ /* It a new vector */\r
+ id = Os_Sys.isrCnt++;\r
+ /* Since OS_ISR_MAX_CNT defines the allocation limit for Os_IsrVarList,\r
+ * we must not allocate more IDs than that */\r
+ assert(id<OS_ISR_MAX_CNT);\r
+\r
+ Os_IsrVarList[id].constPtr = isrPtr;\r
+ Os_VectorToIsr[isrPtr->vector + IRQ_INTERRUPT_OFFSET ] = id;\r
+ Irq_EnableVector( isrPtr->vector, isrPtr->priority, Os_ApplGetCore(isrPtr->appOwner ) );\r
+ }\r