From: vlahan Date: Tue, 10 Jul 2007 00:49:41 +0000 (+0000) Subject: - Fix UartByte to properly disable interrupts before busywaiting on the TX interrupt... X-Git-Tag: release_tools_1_2_4_1~61 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=eb498a4fbc5937d52f6dbfde1c3dd8eb0678cf81;p=tinyos-2.x.git - Fix UartByte to properly disable interrupts before busywaiting on the TX interrupt flag, and clear the flag and enable interrupts back afterwards, problem reported by David M. --- diff --git a/tos/chips/msp430/usart/Msp430UartP.nc b/tos/chips/msp430/usart/Msp430UartP.nc index 290fb606..9393595c 100644 --- a/tos/chips/msp430/usart/Msp430UartP.nc +++ b/tos/chips/msp430/usart/Msp430UartP.nc @@ -157,10 +157,13 @@ implementation { } } - async command error_t UartByte.send( uint8_t data ) { - call Usart.tx( data ); - while( !call Usart.isTxIntrPending() ); - call Usart.clrTxIntr(); + async command error_t UartByte.send( uint8_t data ) { + call Usart.clrTxIntr(); + call Usart.disableTxIntr (); + call Usart.tx( data ); + while( !call Usart.isTxIntrPending() ); + call Usart.clrTxIntr(); + call Usart.enableTxIntr(); return SUCCESS; }