]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Ensure Uart state variables are reset on resource config and unconfig.
authorR. Steve McKown <rsmckown@gmail.com>
Mon, 2 Aug 2010 20:26:29 +0000 (14:26 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Mon, 2 Aug 2010 23:58:05 +0000 (17:58 -0600)
tos/chips/msp430/usci/Msp430UartP.nc

index cdc08089793142d70ef6892dfe40ece057697dce..a35dd92eb8d4b05a2296b1612ecde05f79d30b44 100644 (file)
@@ -104,6 +104,10 @@ implementation {
        call TXD.selectModuleFunc();
       }
 
+      /* Reset important state variables */
+      m_robuf = 0;
+      m_sobuf = 0;
+
       /* Clear interrupts; we'll add them as needed */
       call Registers.clrIeRx();
       call Registers.clrIeTx();
@@ -124,6 +128,10 @@ implementation {
       call Registers.clrIeTx();
       call Registers.clrIfgRx();
 
+      /* Reset important state variables */
+      m_robuf = 0;
+      m_sobuf = 0;
+
       /* Restore pins to their pre-configure state */
       if (m_pins & PINS_RXD)
        call RXD.selectIOFunc();