Hi all,
I have two interrupt routines. First interrupt routine should not be interrupted by the second interrupt routine.
When the second interrupt routine is executed, if the first interrupt is coming, the second interrupt should be hold and CPU executes the first interrupt.
Here is the my setup in the second interrupt routine.
at the begin of the routine
uint32 chipReg[4];
chipReg[0] = CSL_chipReadReg (CSL_CHIP_IRP); // Interrupt Return Pointer Register
chipReg[1] = CSL_chipReadReg (CSL_CHIP_NRP); // Nonmaskable Interrupt (NMI) Return Pointer Register
chipReg[2] = CSL_chipReadReg (CSL_CHIP_ITSR); // Interrupt Task State Register
chipReg[3] = CSL_chipReadReg (CSL_CHIP_CSR); // Control Status Register
CSL_chipWriteReg (CSL_CHIP_CSR, chipReg[3] | 0x00000001); // enable nesting interrupt
........................
at the end of the routine
CSL_chipWriteReg (CSL_CHIP_CSR, chipReg[3] & 0xFFFFFFFE); //disable nesting interrupt
CSL_chipWriteReg (CSL_CHIP_ITSR, chipReg[2]);
CSL_chipWriteReg (CSL_CHIP_NRP, chipReg[1]);
CSL_chipWriteReg (CSL_CHIP_IRP, chipReg[0]);
//clear the interrupt event bit.
CSL_intcHwControl(hIntc[1], CSL_INTC_CMD_EVTCLEAR, NULL);
I sometimes found my CPU is hang.
Do you think if my setup is wrong?
Thank you.
Yao-Ting