aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib/hal_uart.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-30 12:43:41 -0700
committerJosh Blum <josh@joshknows.com>2010-07-30 12:43:41 -0700
commit4240d5a2a1b705fe8ed5c3a1d1deef24be00d444 (patch)
tree6c292d10784049bd5f4e92e69de00f227b279cb1 /firmware/microblaze/lib/hal_uart.c
parent5dca9e6315c5f827d97351316e5bdd3a786dc4f1 (diff)
downloaduhd-4240d5a2a1b705fe8ed5c3a1d1deef24be00d444.tar.gz
uhd-4240d5a2a1b705fe8ed5c3a1d1deef24be00d444.tar.bz2
uhd-4240d5a2a1b705fe8ed5c3a1d1deef24be00d444.zip
usrp2: reorganized firmware directory
Diffstat (limited to 'firmware/microblaze/lib/hal_uart.c')
-rw-r--r--firmware/microblaze/lib/hal_uart.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/microblaze/lib/hal_uart.c b/firmware/microblaze/lib/hal_uart.c
index 75b12b432..fe3b7515a 100644
--- a/firmware/microblaze/lib/hal_uart.c
+++ b/firmware/microblaze/lib/hal_uart.c
@@ -39,16 +39,25 @@ divisor_table[MAX_WB_DIV+1][NSPEEDS] = {
#define u uart_regs
+static char uart_mode = UART_MODE_ONLCR;
+
+void
+hal_uart_set_mode(int mode)
+{
+ uart_mode = mode;
+}
+
void
hal_uart_init(void)
{
+ hal_uart_set_mode(UART_MODE_ONLCR);
u->clkdiv = 217; // 230400 bps
}
void
hal_uart_putc(int ch)
{
- if (ch == '\n') // FIXME for now map \n -> \r\n
+ if (ch == '\n')// && (uart_mode == UART_MODE_ONLCR)) //map \n->\r\n if necessary
hal_uart_putc('\r');
while (u->txlevel == 0) // wait for fifo to have space
@@ -60,7 +69,7 @@ hal_uart_putc(int ch)
void
hal_uart_putc_nowait(int ch)
{
- if (ch == '\n') // FIXME for now map \n -> \r\n
+ if (ch == '\n')// && (uart_mode == UART_MODE_ONLCR)) //map \n->\r\n if necessary
hal_uart_putc('\r');
if(u->txlevel) // If fifo has space