From 08adc54377ded6edd4a58ea3001b28b94290c741 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 14 Nov 2011 13:17:38 +0100 Subject: [PATCH] UARTClass fix for only-first-char-sent issue. --- hardware/sam/cores/sam/UARTClass.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hardware/sam/cores/sam/UARTClass.cpp b/hardware/sam/cores/sam/UARTClass.cpp index 6bd79c022..76a60d3b3 100644 --- a/hardware/sam/cores/sam/UARTClass.cpp +++ b/hardware/sam/cores/sam/UARTClass.cpp @@ -120,10 +120,8 @@ void UARTClass::flush( void ) void UARTClass::write( const uint8_t uc_data ) { /* Check if the transmitter is ready */ - if ( (_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY ) - { - return ; - } + while ( (_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY ) + ; /* Send character */ _pUart->UART_THR = uc_data ;