X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fmsp430%2Fusci%2FHplMsp430UsciInt0P.nc;h=d802a0bf3b66e2163998866bb63580d8934ff57f;hb=a4c683fb39c46c4a0382866e7ca1ab65a524fcf4;hp=9d75d9d9f940bebe5f3d90f27856e1cc760a2253;hpb=a04046a3331f1baba1e6a568613fec5db58bbe7b;p=tinyos-2.x.git diff --git a/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc b/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc index 9d75d9d9..d802a0bf 100644 --- a/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc +++ b/tos/chips/msp430/usci/HplMsp430UsciInt0P.nc @@ -106,9 +106,13 @@ implementation * 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();