cancel
Showing results for 
Search instead for 
Did you mean: 

WIU IRQ

Posted on April 27, 2007 at 15:46

WIU IRQ

1 REPLY 1
Posted on May 17, 2011 at 09:42

Hello,

I'm facing a strange problem:

I configured P3.5 as EXT int.

from inside the irq handler I'm not able to

reset the irq assertion (WIU->PR = WIU_line5) so

the code is in loop in this irq !!!

If I execute the code step by step when I write to WIU->PR

the irq flag is reset.

any idea?

--- my config ---

VIC_ITCmd(EXTIT0_ITLine, DISABLE);

WIU_ClearITPendingBit(WIU_Line5); //P3.5

WIU_InitStructure.WIU_Mode = WIU_Mode_Interrupt ;

WIU_InitStructure.WIU_Line = WIU_Line5 ;

WIU_InitStructure.WIU_TriggerEdge = WIU_FallingEdge ;

WIU_Init(&WIU_InitStructure);

/* Select WIU line 5 as VIC1.10 interrupt source */

SCU_WakeUpLineConfig(5);

USB_Cable_Config( ENABLE );

VIC_Config(EXTIT0_ITLine, VIC_IRQ, 8);

VIC_ITCmd(EXTIT0_ITLine, ENABLE);

-----

irq handler:

void EXTIT0_IRQHandler(void)

{

static int busState = VBUS_CONNECTED;

register int pin_status = GPIO3->DR[GPIO_Pin_5<

if ( !pin_status )

{

/* trigger on rising edge */

WIU->TR |= WIU_Line5;

}

else

{

/* trigger on falling edge */

WIU->TR &= ~WIU_Line5;

}

// WIU->PR = 0xFFFFFFFC;

WIU->PR = WIU_Line5; // clear all pending events on port 3

}