2008-10-31 04:21 AM
2011-05-17 12:56 AM
I may have found the problem. There was a bug in my copy of 91x_wiu.c.
Changed: WIU->CTRL &= WIU_Enable ; to WIU->CTRL &= ~WIU_Enable ;2011-05-17 12:56 AM
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:Code:
VIC_ITCmd(EXTIT2_ITLine,DISABLE);WIU_Cmd(DISABLE);
// 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 withCode:
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.