We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am trying to make a simple main program that waits on an External rising edge interrupt from INTO (P2.10 KEIL 1760). The main code does the configuration for the interrupt then sits in a loop. And should wait for the Interrupt to call void HandleInetrrupt0.
I would like to know what syntax is missing in front of the void HandleInetrrupt0() so the compiler knows that it should be called when INTO 0 triggers it. Also I am not sure that this interrupt is enable properly. Since it look disabled from the interrupt vector controller when being simulated on uVision.
/*---------------------------------------------------------------------------- External Interrupt 0 code *----------------------------------------------------------------------------*/ void HandleInetrrupt0(){ //EINT0_IRQHandler } /*---------------------------------------------------------------------------- Main Program *----------------------------------------------------------------------------*/ int main (void) { LPC_GPIO2->FIODIR &= ~(1<<10);//P2.10 as input LPC_GPIOINT->IO2IntEnR |=1<<10; //Enable Rising Edge on INT0 P2.10 LPC_SC->EXTMODE =0x1; //Edge mode while(1){} }
Ok, I found the solution..
The syntax is as follows.
__irq void EINT0_IRQHandler(void)){ //EINT0_IRQHandler LPC_SC->EXTINT &=0xFFFFFFFF; toggleLED(); }
EINT0_IRQHandler has already been defined in the .s file along with the other interrupts.