From e18db9f0cffcb143e5fdec27539efb417cb4ebf3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 24 Jun 2013 17:29:11 +0200 Subject: termios: Update due to API changes Termios notifies now the driver about an inactive transmit with the length argument set to zero. --- c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'c/src/lib/libcpu/sh/sh7750/sci') diff --git a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c index 8400a20dd4..a2b2dadbc8 100644 --- a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c +++ b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c @@ -761,24 +761,21 @@ sh4uart2_interrupt_transmit(rtems_vector_number vec) rtems_status_code sh4uart_interrupt_write(sh4uart *uart, const char *buf, int len) { - volatile uint8_t *scr1 = (volatile uint8_t *)SH7750_SCSCR1; - volatile uint16_t *scr2 = (volatile uint16_t *)SH7750_SCSCR2; - int level; - - while ((SCSSR1 & SH7750_SCSSR1_TEND) == 0); - - rtems_interrupt_disable(level); + if (len > 0) { + volatile uint8_t *scr1 = (volatile uint8_t *)SH7750_SCSCR1; + volatile uint16_t *scr2 = (volatile uint16_t *)SH7750_SCSCR2; - uart->tx_buf = buf; - uart->tx_buf_len = len; - uart->tx_ptr = 0; + while ((SCSSR1 & SH7750_SCSSR1_TEND) == 0); - if (uart->chn == SH4_SCI) - *scr1 |= SH7750_SCSCR_TIE; - else - *scr2 |= SH7750_SCSCR_TIE; + uart->tx_buf = buf; + uart->tx_buf_len = len; + uart->tx_ptr = 0; - rtems_interrupt_enable(level); + if (uart->chn == SH4_SCI) + *scr1 |= SH7750_SCSCR_TIE; + else + *scr2 |= SH7750_SCSCR_TIE; + } return RTEMS_SUCCESSFUL; } -- cgit v1.2.3