]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usci/Msp430UartP.nc
Fix USCI hanging caused by clearing the TXIFG bit.
[tinyos-2.x.git] / tos / chips / msp430 / usci / Msp430UartP.nc
index 06ea790323fa9ff95e81ee100feb7ad34c7fb45c..1b595bfdbd9af40369beceb8128264f6f6620183 100644 (file)
@@ -123,7 +123,6 @@ implementation {
       call Registers.clrIeRx();
       call Registers.clrIeTx();
       call Registers.clrIfgRx();
-      call Registers.clrIfgTx();
 
       /* Restore pins to their pre-configure state */
       if (m_pins & PINS_RXD)
@@ -152,6 +151,7 @@ implementation {
        return FAIL;
       m_sobuf = buf;
       m_solen = len;
+      while (!call Registers.getIfgTx());
       call Registers.setIeTx();
       call Registers.setTxbuf(*m_sobuf);
       m_slen = m_solen - 1;
@@ -170,7 +170,6 @@ implementation {
     }
     if (m_slen == 0 && m_sobuf) {
       call Registers.clrIeTx();
-      call Registers.clrIfgTx();
       m_sobuf = 0;
       signal UartStream.sendDone(m_sobuf, m_solen, SUCCESS);
     }