From: R. Steve McKown Date: Mon, 2 Aug 2010 20:26:29 +0000 (-0600) Subject: Ensure Uart state variables are reset on resource config and unconfig. X-Git-Tag: release/2.1.1-4.4~15 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=dfbae4ae464c8990d122cc07951edcdbc1983ac4 Ensure Uart state variables are reset on resource config and unconfig. --- diff --git a/tos/chips/msp430/usci/Msp430UartP.nc b/tos/chips/msp430/usci/Msp430UartP.nc index cdc08089..a35dd92e 100644 --- a/tos/chips/msp430/usci/Msp430UartP.nc +++ b/tos/chips/msp430/usci/Msp430UartP.nc @@ -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();