summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/sh/sh7750/sci
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-24 17:29:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-25 17:03:21 +0200
commite18db9f0cffcb143e5fdec27539efb417cb4ebf3 (patch)
tree804edba552541bea8d5ea5c38680903373bf6c27 /c/src/lib/libcpu/sh/sh7750/sci
parentbsps/arm: Rename function (diff)
downloadrtems-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/libcpu/sh/sh7750/sci')
-rw-r--r--c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c27
1 files changed, 12 insertions, 15 deletions
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;
}