With msp430 mcu, i try to handle interrupts on port1 with the bits 0,1,2,3. The problem is it only recognizes for the BUTTON0 (P1.0). I also implemented, P1 direction bits and P1 interrupt enable bits.To do this, i have written this code.
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
WDTCTL = WDT_ADLY_250; IFG1 &= ~WDTIFG; /* clear interrupt flag */
if((P1IN & BUTTON3)!=BUTTON3 ){
if(cursor != 6){
cursor++;
}
}
else if((P1IN & BUTTON2)!=BUTTON2){
if(cursor != 0){
cursor--;
}
}
else if((P1IN & BUTTON1)!=BUTTON1){
yapilanDegisiklikler[cursor]++;
}
else if((P1IN & BUTTON0)!=BUTTON0){
yapilanDegisiklikler[cursor]--;
}
P1IFG &= ~(BUTTON3+BUTTON2+BUTTON1+BUTTON0);
}