Sorry for my english. I think that some misunderstanding can come from this.
I said that I have the same problem because when I transfered my project to use the mqx4.0, I had a lot of error with the function _cortex_int_init(). But I tried to replace it with the _nvic_int_init() function and it worked perfectly.
I fact I did'nt found the nvic_int_init in the psp.a file because I done a mistake. But now I found it.
for the code.
void Quad_Config(_QUAD QuadNumber, int_16 Resolution, boolean EnableInterrupt)
{
FTM_MemMapPtr PeripheralBase;
PeripheralBase = Quad_GetPeripheral(QuadNumber);
if(PeripheralBase != NULL)
{
if(QuadNumber == QUAD_1)
{
SIM_SCGC6 |= SIM_SCGC6_FTM1_MASK;
}
else if (QuadNumber == QUAD_2)
{
SIM_SCGC3 |= SIM_SCGC3_FTM2_MASK;
}
if(EnableInterrupt == TRUE)
{
FTM_PDD_EnableOverflowInterrupt(PeripheralBase);
}
FTM_PDD_WriteFeaturesModeReg(PeripheralBase, 1);
FTM_PDD_WriteConfigurationReg(PeripheralBase, 96);
FTM_PDD_WriteModuloReg(PeripheralBase, Resolution);
FTM_PDD_InitializeCounter(PeripheralBase);
FTM_PDD_WriteQuadratureDecoderReg(PeripheralBase, 1);
if(QuadNumber == QUAD_1)
{
FTM1_SC |= FTM_SC_CLKS(1);
PORTA_PCR(8) = PORT_PCR_MUX(6);
PORTA_PCR(9) = PORT_PCR_MUX(6);
if(EnableInterrupt == TRUE)
{
FTM_PDD_EnableOverflowInterrupt(PeripheralBase);
_int_install_isr(INT_FTM1, (void(_CODE_PTR_)(pointer))Quad_irq_callback, (void *)1);
_nvic_int_init(INT_FTM1, 4, TRUE);
// _cortex_int_init(INT_FTM1, 4, TRUE);
}
}
else if (QuadNumber == QUAD_2)
{
FTM2_SC |= FTM_SC_CLKS(1);
PORTB_PCR(18) = PORT_PCR_MUX(6);
PORTB_PCR(19) = PORT_PCR_MUX(6);
if(EnableInterrupt == TRUE)
{
FTM_PDD_EnableOverflowInterrupt(PeripheralBase);
_int_install_isr(INT_FTM2, (void(_CODE_PTR_)(pointer))Quad_irq_callback, (void *)2);
// _cortex_int_init(INT_FTM2, 4, TRUE);
_nvic_int_init(INT_FTM2, 4, TRUE);
}
}
}
}
I put the complete project in attachement.
I don't know if it will help you.