void main() { GPIOSetDir(PORT2,4,0); GPIOSetInterrupt(PORT2, 4, 0, 0, 1); GPIOIntEnable(PORT2, 4); while(1){} } void PIOINT2_IRQHandler(void) { //do something bool regVal = 0; regVal = GPIOIntStatus(PORT2, 4)); if(regVal) { GPIOIntClear(PORT2, 4); } } |
void main() { GPIOSetDir(PORT2,4,0); GPIOSetInterrupt(PORT2, 4, 0, 0, 1); GPIOIntEnable(PORT2, 4); while(1){} } void PIOINT2_IRQHandler(void) { //do something bool regVal = 0; regVal = GPIOIntStatus(PORT2, 4)); if(regVal) { GPIOIntClear(PORT2, 4); } } |