From dfbae4ae464c8990d122cc07951edcdbc1983ac4 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Mon, 2 Aug 2010 14:26:29 -0600 Subject: [PATCH] Ensure Uart state variables are reset on resource config and unconfig. --- tos/chips/msp430/usci/Msp430UartP.nc | 8 ++++++++ 1 file changed, 8 insertions(+) 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(); -- 2.39.2