* modes.
*/
TOSH_SIGNAL(USCIAB0TX_VECTOR) {
- if (READ_FLAG(UC0IFG & UC0IE, UCB0RXIE))
- signal IntB.rx(UCB0RXBUF); /* I2C receive */
- else if (READ_FLAG(UC0IFG & UC0IE, UCA0TXIFG))
+ if (READ_FLAG(UC0IFG & UC0IE, UCB0RXIE)) {
+ /* I2C receive. Do not read UCB0RXBUF here, as the code receiving
+ * IntB.rx() may first need to set stop and/or start bits. The receiver
+ * must read UCB0RXBUF.
+ */
+ signal IntB.rx(0);
+ } else if (READ_FLAG(UC0IFG & UC0IE, UCA0TXIFG))
signal IntA.tx();
else if (READ_FLAG(UC0IFG & UC0IE, UCB0TXIFG))
signal IntB.tx();