Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Hello
I nee to detect a rising/falling edge on an input but only when I decide it.
So I'm using a GPO mapped to the Input X-BAR (input13) to the PIE via XINT4.
I made the following configuration:
Init time:
GPIO_SetupXINT4Gpio(DV_GPIO_TOR_IN_CAPTURE_1_ID_PIN);
/* ISR mapping and enable */
Interrupt_register(INT_XINT4, CT_Tor_iCapture1ISR);
/* First: Configure XINT4 */
XintRegs.XINT4CR.bit.POLARITY = 1; /* rising edge interrupt (Falling if input is inverted */
/* Second: Enable XINT4 (POLARITY bit must be set before ENABLE bit) */
XintRegs.XINT4CR.bit.ENABLE = 1; /* Enable XINT4 */
Then in the product life, when I want capture the input rising edge, I made following:
Interrupt_enable(INT_XINT4);
XintRegs.XINT4CR.bit.ENABLE = 1;
And to disable capture when I do not want capture the input:
XintRegs.XINT4CR.bit.ENABLE = 0;
Interrupt_disable(INT_XINT4);
This seems work fine. I have just a problem:
If Rising edge occurs during interrupt are disable, the interrupt routine is called as soon as the interrupt is enabled. This behavior, in my case is bad, I only need call the interrupt routine when Input rising edge occurs WHEN interrupt are enable, not need to call routine on the enable function if rising occurs during disabling...
How can I do to clear the interrupt flag XINT4??? I not found it!..?
Thank