mahyarab
Newbie level 4
this is my code:
volatile uint32_t eint0_counter;
void EINT0_IRQHandler ()
{
LPC_SC->EXTINT = EINT0;
eint0_counter++;
if ( eint0_counter & 0x01 )
{
LPC_GPIO0->FIOSET = 1<<22;
}
else
{
}
}
uint32_t EINTInit()
{
LPC_PINCON->PINSEL4 = 0x00100000;
LPC_GPIO0->FIODIR = 1<<22;
LPC_GPIO2->FIOCLR = 0x000000FF;
LPC_GPIOINT->IO2IntEnF = 0x200;
LPC_SC->EXTMODE = EINT0_EDGE;
LPC_SC->EXTPOLAR = 0;
NVIC_EnableIRQ(EINT0_IRQn);
return 0;
}
i thinks its not have any bugs but its note works for me.
when i enable external interrupt its not do any thing.
volatile uint32_t eint0_counter;
void EINT0_IRQHandler ()
{
LPC_SC->EXTINT = EINT0;
eint0_counter++;
if ( eint0_counter & 0x01 )
{
LPC_GPIO0->FIOSET = 1<<22;
}
else
{
}
}
uint32_t EINTInit()
{
LPC_PINCON->PINSEL4 = 0x00100000;
LPC_GPIO0->FIODIR = 1<<22;
LPC_GPIO2->FIOCLR = 0x000000FF;
LPC_GPIOINT->IO2IntEnF = 0x200;
LPC_SC->EXTMODE = EINT0_EDGE;
LPC_SC->EXTPOLAR = 0;
NVIC_EnableIRQ(EINT0_IRQn);
return 0;
}
i thinks its not have any bugs but its note works for me.
when i enable external interrupt its not do any thing.