This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553,I2c接收中断,uart接收中断,共享一个中断向量,我使用了中断标志位却还是只能用IIC中断。

#pragma vector = USCIAB0TX_VECTOR
__interrupt void USCIAB0TX_ISR(void)
{
     if(((IFG2&UCB0TXIFG)>0)||((IFG2&UCB0RXIFG)>0))   判断IIC中断
{
   _disable_interrupts(); 
    if(I2C_State==TX_STATE) 
   I2C_TxFrame_ISR(); 
   else
   I2C_RxFrame_ISR(); 
   if(RxByteCnt == 0 || TxByteCnt == 0) 
   __bic_SR_register_on_exit(CPUOFF); 
  _enable_interrupts(); 
 
}
else if((IFG2&UCA0TXIFG)==UCA0TXIFG)    判断UART中断
{
    IFG2&=~UCA0TXIFG; 
    UART_OnTx();
}
}