对于其他中断,进入中断后需要进行中断类型判断:
- // Timer0_A1 Interrupt Vector (TAIV) handler
- #pragma vector=TIMER0_A1_VECTOR
- __interrupt void TIMER0_A1_ISR(void)
- {
- switch(__even_in_range(TA0IV, TA0IV_TAIFG))
- {
- case TA0IV_NONE: break; // No interrupt
- case TA0IV_TACCR1: break; // CCR1 not used
- case TA0IV_TACCR2: break; // CCR2 not used
- case TA0IV_TACCR3: break; // reserved
- case TA0IV_TACCR4: break; // reserved
- case TA0IV_TACCR5: break; // reserved
- case TA0IV_TACCR6: break; // reserved
- case TA0IV_TAIFG: // overflow
- P1OUT ^= BIT0;
- break;
- default: break;
- }
- }
|