char putchar (char c)
{
if (c == '\n')
{
/* put '\r' to hardware here */
/* Wait transmission is completed : otherwise the first data is not sent */
while (!(LINUART_SR & 0x40));
LINUART_DR = ('\r');
/* Wait transmission is completed */
while (!(LINUART_SR & 0x40));
}
/* put c to hardware here */
/* Wait transmission is completed : otherwise the first data is not sent */
while (!(LINUART_SR & 0x80));
LINUART_DR = (c);
/* Wait transmission is completed */
while (!(LINUART_SR & 0x80));