_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/interrupt
while(1);
}
#pragma vector=PORT1_VECTOR
__interrupt void Port1_ISR()
{
//The code below is a reference handle process,the interrupt related with the port never used should be delete。
if((P1IFG&BIT0) == BIT0)
{
//Handle the Interrupt generated by P1IN.0
P1IFG &= ~BIT0; //Clear the IFG
//Insert User Code Here
}
else if((P1IFG&BIT1) ==BIT1)
{
//Handle the Interrupt generated by P1IN.1
P1IFG &= ~BIT1; //Clear the IFG
//Insert User Code Here
}
else if((P1IFG&BIT2) ==BIT2)
{
//Handle the Interrupt generated by P1IN.2
P1IFG &= ~BIT2; //Clear the IFG
//Insert User Code Here
}
else if((P1IFG&BIT3) ==BIT3)
{
//Handle the Interrupt generated by P1IN.3
P1IFG &= ~BIT3; //Clear the IFG
//Insert User Code Here
P1OUT ^= BIT6; // P1.0 = toggle
}
else if((P1IFG&BIT4) ==BIT4)
{
//Handle the Interrupt generated by P1IN.4
P1IFG &= ~BIT4; //Clear the IFG
//Insert User Code Here
}
else if((P1IFG&BIT5) ==BIT5)
{
//Handle the Interrupt generated by P1IN.5
P1IFG &= ~BIT5; //Clear the IFG
//Insert User Code Here
}
else if((P1IFG&BIT6) ==BIT6)
{
//Handle the Interrupt generated by P1IN.6
P1IFG &= ~BIT6; //Clear the IFG
//Insert User Code Here
}
else
{
//Handle the Interrupt generated by P1IN.7
P1IFG &= ~BIT7; //Clear the IFG
//Insert User Code Here
}
#pragma vector=USI_VECTOR
__interrupt void USI_ISR()
{
//Insert User Code Here
}
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR()
{
//Insert User Code Here
}
#pragma vector=TIMERA1_VECTOR
__interrupt void TIMERA1_ISR() // the interrupt source is CC1~2
{
switch (TAIV)
{
case 2:
//capture/compare1 interrupt
//Insert User Code Here
break;
case 4:
//capture/compare2 interrupt MSP430G2231 donot have the compare2 module
//Insert User Code Here
break;
case 10:
//TAIFG Timer overflow interrupt
//Insert User Code Here
P1OUT ^= BIT6; // change the status of green led when TimerA overflow
TACTL &= ~BIT0;
if(flag)//i++;
i += 4095;
else //i--;
i -=4095;
if(i > 0x7fff) flag = 0;
if(i == 0) flag = 1;
CCR1 = i; //change the duty-cycle
break;
}
}
#pragma vector=TIMERA0_VECTOR
__interrupt void TIMERA0_ISR() // the interrupt source is CC0
{
//Insert User Code Here