]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usci/Msp430UartP.nc
Fix last UartSend.send() lost when immediately followed by UartStream.send().
[tinyos-2.x.git] / tos / chips / msp430 / usci / Msp430UartP.nc
index 4545aab3a0872b24b7eefc7f244126ef663187fb..ddf074bdd0952100c4319207af6fcdb2a6d3a5ff 100644 (file)
@@ -61,14 +61,14 @@ implementation {
 
   uint8_t m_pins;
   uint8_t* m_sobuf;    /* Original buffer ptr from UartStream.send() */
-  uint8_t m_solen;     /* Original buffer len from UartStream.send() */
+  uint16_t m_solen;    /* Original buffer len from UartStream.send() */
   uint8_t* m_sbuf;     /* Position of next char to send */
-  uint8_t m_slen;      /* Len of chars in m_sbuf to send */
+  uint16_t m_slen;     /* Len of chars in m_sbuf to send */
   bool m_rxie;         /* Set if rxie has been enabled to UartStream.receive() */
   uint8_t* m_robuf;    /* Original receive buffer */
-  uint8_t m_rolen;     /* Original (maximum) receive len */
+  uint16_t m_rolen;    /* Original (maximum) receive len */
   uint8_t* m_rbuf;     /* Position of next byte in which to receive a char */
-  uint8_t m_rlen;      /* Remaining length in receive buffer */
+  uint16_t m_rlen;     /* Remaining length in receive buffer */
 
   sfrb(MYBRX, 219U);
 
@@ -152,6 +152,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;