I configured port 2.4 for GPIO, it is currently hooked up to a button.
P2SEL &= ~BIT4; // Set P2.4 as GPIO
P2DIR &= ~BIT4; // Set P2.4 as input
P2IE |= BIT4;
P2IES |= BIT4;
On the ISR, I count the number of times the button has been pressed and I seem to be needing some debouncing. How do I do that? This is the ISR code
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void){
switch( P2IV ){
case P2IV_NONE: break;
case P2IV_P2IFG0: break;
case P2IV_P2IFG1: break;
case P2IV_P2IFG2: break;
case P2IV_P2IFG3: break;
case P2IV_P2IFG4:
count++;
break;
case P2IV_P2IFG5: break;
case P2IV_P2IFG6: break;
case P2IV_P2IFG7: break;
}