From eb498a4fbc5937d52f6dbfde1c3dd8eb0678cf81 Mon Sep 17 00:00:00 2001 From: vlahan Date: Tue, 10 Jul 2007 00:49:41 +0000 Subject: [PATCH] - 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. --- tos/chips/msp430/usart/Msp430UartP.nc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; } -- 2.39.2