* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * - Neither the name of the Technische Universität Berlin nor the names
+ * - Neither the name of the Titanium Mirror, Inc. nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
implementation {
enum {
/* Bit positions in m_pins */
- PINS_RXD = 1,
+ PINS_RXD = 0,
PINS_TXD
};
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();
/* Enable the device */
call Registers.clrCtl1(UCSWRST);
+
+ /* TOS convention is for receive interrupts on by default. */
+ call Registers.clrIfgRx();
+ call Registers.setIeRx();
}
}
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)
+ if (m_pins & (1 << PINS_RXD))
call RXD.selectIOFunc();
- if (m_pins & PINS_TXD)
+ if (m_pins & (1 << PINS_TXD))
call TXD.selectIOFunc();
}
}
async event void Interrupts.i2cStop() {}
async event void Interrupts.i2cCal() {}
async event void Interrupts.brk() {}
- async event void Interrupts.i2cNak() {}
+ async event void Interrupts.i2cNack() {}
async event void Counter.overflow() {}
default async event void UartStream.sendDone( uint8_t* buf, uint16_t len,