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 use the external interrupt INT0 that call the function IO_vidHandlerButton1() when the interrupt is to be serviced. The code did work before but now the function is not call anymore by the ISR whereas a falling edge on the pin of the INT0 wakes up the micro and sets its interrupt flag in the EXTINT register. Does anybody know what the problem is?
u8 IO_u8Init(void) { IO_bButton1 = 0; USER_u8FLAG_INT_BUTTON = BTY_u8CLEAR; EXTINT = EINT0_FLAG; /* clear interrupt */ /* disabled interrupts before write the interrup's registers */ IRQ_u8Disable(IO_U8BUTTON1_INT); /* assertion of an EINT0 interrupt will wake up the processor from Power Down mode */ INTWAKE |= EXTWAKE0; PINSEL4 |= 0x00100000; /* activate the pin P2.10 to works as external interrupt */ PINSEL4 &= ~0x00200000; /* enables the falling edge interrupt for the pins P2.10, P2.11 and P2.12 */ EXTMODE |= EINT0_EDGE; /* INT edge trigger */ EXTPOLAR &= ~(EXTPOLAR0); /* INT0 is falling edge sensitive */ EXTINT = EINT0_FLAG; /* clear interrupt before enabling the interrupt */ /* Install the Interrupt Service routines (ISRs) for the button 1 IRQ */ if ( IRQ_u8Install( IO_U8BUTTON1_INT, (void *)IO_vidHandlerButton1, IRQ_u8PRIORITY6 ) == BTY_u8FALSE ) { return( BTY_u8FALSE ); /* very bad happened */ } return( BTY_u8TRUE ); } void IO_vidHandlerButton1 (void) __irq { EXTINT = EINT0_FLAG; /* clear interrupt */ IO_bButton1 = BTY_u8TRUE; USER_u8FLAG_INT_BUTTON = BTY_u8SET; VICVectAddr = 0; /* Acknowledge Interrupt */ } u8 IRQ_u8Install( u8 u8IntNumber, void *HandlerAddr, u8 u8Priority ) { u32 *vect_addr; u32 *vect_cntl; VICIntEnClr = (u32)1 << u8IntNumber; /* Disable Interrupt */ if ( u8IntNumber >= u8VIC_SIZE ) { return ( BTY_u8FALSE ); } else { /* find first un-assigned VIC address for the handler */ vect_addr = (u32 *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + (u32)u8IntNumber*4); vect_cntl = (u32 *)(VIC_BASE_ADDR + VECT_CNTL_INDEX + (u32)u8IntNumber*4); *vect_addr = (u32)HandlerAddr; /* set interrupt vector */ *vect_cntl = (u32)u8Priority; VICIntEnable = (u32)1 << u8IntNumber; /* Enable Interrupt */ return( BTY_u8TRUE ); } }