Hello,
The Vector information is stored in the 'Exception Frame Structure'
You can use one Generic Interrupt asm Handler to save the 'Exception Frame Address' and call a C Function to manage Vector.
//---------------------------------------------------------------------------------------------------------------------------------
__interrupt__ void ISR_Asm_User(void);
_ISR_Asm_User:
lea -60(SP),SP // Stack for 'movem'
movem.l D0-D7/A0-A6,(SP) // Save Registers
pea.l 60(SP) // Push 'Exception Frame Address'
jsr _IRQ_Interruption // Generic C Fonction IRQ_Interruption(void *ExceptionFrame)
movem.l 4(SP),D0-D7/A0-A6 // Restore Registers
lea 64(SP),SP // Restore SP
rte
//---------------------------------------------------------------------------------------------------------------------------------
void IRQ_Interruption(void *ExceptionFrame_P)
{
register INT Vector_L;
// Extract Vector Number
Vector_L = MCF5XXX_RD_SF_VECTOR(ExceptionFrame_P);
// Manage Vector
if (Vector_L < NB_MAX_VECTORS)
{
if (TableIRQ_G[Vector_L].Procedure != NULL)
{
// Call Vector Procedure(void *Parameters) from your Own IRQ Table
(TableIRQ_G[Vector_L].Procedure)(TableIRQ_G[Vector_L].Parameters);
}
}
}
//---------------------------------------------------------------------------------------------------------------------------------
I Hope this helps..
Bye
<< Freescale MCF5234/35 with CodeWarrior 6.2 >>