X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fmsp430%2Fusci%2FHplMsp430UsciInt0P.nc;h=1ba7ef20668adcf4ec1fd65226b53db1a970fc53;hb=c4a3d36739346681572c7eda2a6243a8634474db;hp=8c3a34510f789fed01a2a6095b996ccc6abc0eae;hpb=b054fbe2a8deacc35f0067deb15274da53d96984;p=tinyos-2.x.git diff --git a/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc b/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc index 8c3a3451..1ba7ef20 100644 --- a/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc +++ b/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc @@ -62,8 +62,9 @@ implementation 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)) { @@ -75,16 +76,9 @@ implementation 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(); @@ -94,8 +88,9 @@ implementation 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)) @@ -115,6 +110,7 @@ implementation 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() {}