diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-24 17:29:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-25 17:03:21 +0200 |
commit | e18db9f0cffcb143e5fdec27539efb417cb4ebf3 (patch) | |
tree | 804edba552541bea8d5ea5c38680903373bf6c27 /c/src/lib/libbsp/sparc/leon3/console/console.c | |
parent | bsps/arm: Rename function (diff) | |
download | rtems-e18db9f0cffcb143e5fdec27539efb417cb4ebf3.tar.bz2 |
termios: Update due to API changes
Termios notifies now the driver about an inactive transmit with the
length argument set to zero.
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; } |