MSP430REG_NORACE(UCB0RXBUF);
#endif
- /* This USCI_Ax and USCI_Bx interrupt vector signals receive events for UART
- * and SPI modes, and status events for I2C modes. Only Bx can do I2C.
+ /* This interrupt vector signals receive events. USCI_A0 can receive events
+ * for UART and SPI modes, while USCI_B0 can receive events for I2C and SPI
+ * modes.
*/
TOSH_SIGNAL(USCIAB0RX_VECTOR) {
if (READ_FLAG(UC0IFG, UCA0RXIFG)) {
signal IntA.brk();
} else
signal IntA.rx(c);
- } else if (READ_FLAG(UC0IFG, UCB0RXIFG)) {
- volatile uint8_t c = UCB0RXBUF; /* read to clear UCB0RXIFG */
- if (READ_FLAG(UCB0CTL1, UCBRK)) {
- CLR_FLAG(UCB0CTL1, UCBRK);
- if (READ_FLAG(UCB0CTL0, UCMODE_3) == UCMODE_3)
- CLR_FLAG(UCB0CTL1, UCDORM);
- signal IntB.brk();
- } else
- signal IntB.rx(c);
- } else if (READ_FLAG(UCB0STAT, UCALIFG))
+ } else if (READ_FLAG(UC0IFG, UCB0RXIFG))
+ signal IntB.rx(UCB0RXBUF); /* read clears UCB0RXIFG */
+ else if (READ_FLAG(UCB0STAT, UCALIFG))
signal IntB.i2cCal();
else if (READ_FLAG(UCB0STAT, UCNACKIFG))
signal IntB.i2cNak();
signal IntB.i2cStop();
}
- /* This USCI_Ax and USCI_Bx interrupt vector signals transmit events for UART
- * and SPI modes, and rx/tx events for I2C modes. Only Bx can do I2C.
+ /* This interrupt vector signals transmit events. USCI_A0 can receive events
+ * for UART and SPI modes, while USCI_B0 can receive events for I2C and SPI
+ * modes.
*/
TOSH_SIGNAL(USCIAB0TX_VECTOR) {
if (READ_FLAG(UC0IFG, UCB0RXIFG))
default async event void IntA.i2cStart() {}
default async event void IntA.i2cStop() {}
+ /* UART is not available for B devices, so IntB.brk() is never sitnalled */
default async event void IntB.brk() {}
default async event void IntB.rx(uint8_t byte) {}
default async event void IntB.tx() {}