diff options
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/console/console.c')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/console/console.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c index 3870685b50..566b0581f6 100644 --- a/c/src/lib/libbsp/sparc/leon3/console/console.c +++ b/c/src/lib/libbsp/sparc/leon3/console/console.c @@ -117,27 +117,24 @@ void console_isr(void *arg) */ int console_write_interrupt(int minor, const char *buf, int len) { - struct apbuart_priv *uart; - unsigned int oldLevel; - - if (minor == 0) - uart = &apbuarts[syscon_uart_index]; - else - uart = &apbuarts[minor - 1]; + if (len > 0) { + struct apbuart_priv *uart; - /* Remember what position in buffer */ + if (minor == 0) + uart = &apbuarts[syscon_uart_index]; + else + uart = &apbuarts[minor - 1]; - rtems_interrupt_disable(oldLevel); + /* Remember what position in buffer */ - /* Enable TX interrupt */ - uart->regs->ctrl |= LEON_REG_UART_CTRL_TI; + /* Enable TX interrupt */ + uart->regs->ctrl |= LEON_REG_UART_CTRL_TI; - /* start UART TX, this will result in an interrupt when done */ - uart->regs->data = *buf; + /* start UART TX, this will result in an interrupt when done */ + uart->regs->data = *buf; - uart->sending = 1; - - rtems_interrupt_enable(oldLevel); + uart->sending = 1; + } return 0; } |