I'm trying to set up an external interrupt in my application. As far as I can tell, I need to set this up via the WIU peripheral, even though I don't really want it to wake the processor; just provide an interrupt when the pin state changes.
I've set it up as follows:
Code:
WIU_InitTypeDef WIU_InitStruct;
WIU_StructInit(&WIU_InitStruct); WIU_InitStruct.WIU_TriggerEdge = WIU_FallingEdge; WIU_InitStruct.WIU_Line = WIU_Line22; WIU_Init(&WIU_InitStruct); WIU_Cmd(ENABLE); SCU_WakeUpLineConfig(22); VIC_ITCmd(EXTIT2_ITLine, DISABLE); VIC_Config(EXTIT2_ITLine, VIC_IRQ, 15);This works for setting up the ISR. However, I need to disable this interrupt (and only this interrupt) occasionally. I have tried doing this as follows:
// Do stuff VIC_ITCmd(EXTIT2_ITLine,ENABLE);WIU_Cmd(ENABLE);However the ISR still gets called in the middle of the ''do stuff'' section. Within the ISR I clear the interrupt flags with
Code:
WIU_ClearITPendingBit(22);
WIU_ClearITPendingBit(WIU_Line22);What am I doing wrong? How do I temporarily disable the EXTIT and/or WIU interrupts? Thanks in advance.