int main (void) { SystemInit(); GPIO_PinDirection(LED1,OUTPUT); /* Configure the pins as Output to blink the Leds*/ GPIO_PinDirection(LED2,OUTPUT); EINT_AttachInterrupt(EINT0,myExtIntrIsr_0,FALLING); /* myExtIntrIsr_0 will be called by EINT0_IRQHandler */ EINT_AttachInterrupt(EINT1,myExtIntrIsr_1,FALLING); /* myExtIntrIsr_1 will be called by EINT1_IRQHandler */ while(1) { //do nothing } }
int main (void) { SystemInit(); /* RS RW EN D0 D1 D2 D3 D4 D5 D6 D7 P_NC(Not connected)*/ LCD_SetUp(P2_0,P2_1,P2_2,P_NC,P_NC,P_NC,P_NC,P1_24,P1_25,P1_26,P1_27); LCD_Init(2,16); /* EINT0 is configured as FallingEdge interrupt and myExtIntrIsr_0 will be called by EINT0_IRQHandler */ EINT_AttachInterrupt(EINT0,myExtIntrIsr_0,FALLING); /* EINT1 is configured as Active Low interrupt and myExtIntrIsr_1 will be called by EINT1_IRQHandler */ EINT_AttachInterrupt(EINT1,myExtIntrIsr_1,LOW); while(1) { LCD_GoToLine(0); LCD_Printf("EINT0=%8u EINT1:%8u",cnt1,cnt2); /* Display the occurrence of EINT0 and EINT1 */ } }