summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-23 14:20:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-24 08:46:32 +0200
commitdf8341ae30cddbbf463c85a04d89dcfe9085c1f6 (patch)
tree059c27f9fe81b19d58125689d4de58bcb92a0330
parentcdf30f0550432648ac005e3f71814b7f708a4ce3 (diff)
downloadrtems-df8341ae30cddbbf463c85a04d89dcfe9085c1f6.tar.bz2
bsp/gen5200: Simplify interrupt write support
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/console/console.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
index c2e093c62a..0ccb52fda9 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/console/console.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
@@ -327,11 +327,6 @@ static void mpc5200_psc_interrupt_handler(rtems_irq_hdl_param handle)
if (isr & ISR_TX_RDY & channel_info[minor].shadow_imr) {
channel_info[minor].tx_interrupts++;
- /*
- * mask interrupt
- */
- psc->isr_imr = channel_info[minor].shadow_imr &= ~(IMR_TX_RDY);
-
if (ttyp[minor] != NULL) {
#ifndef SINGLE_CHAR_MODE
rtems_termios_dequeue_characters(
@@ -581,11 +576,12 @@ static ssize_t mpc5200_uart_write(
size_t len
)
{
+ struct mpc5200_psc *psc =
+ (struct mpc5200_psc *)(&mpc5200.psc[psc_minor_to_regset[minor]]);
+
if (len > 0) {
int frame_len = len;
const char *frame_buf = buf;
- struct mpc5200_psc *psc =
- (struct mpc5200_psc *)(&mpc5200.psc[psc_minor_to_regset[minor]]);
/*
* Check tx fifo space
@@ -609,6 +605,11 @@ static ssize_t mpc5200_uart_write(
* unmask interrupt
*/
psc->isr_imr = channel_info[minor].shadow_imr |= IMR_TX_RDY;
+ } else {
+ /*
+ * mask interrupt
+ */
+ psc->isr_imr = channel_info[minor].shadow_imr &= ~(IMR_TX_RDY);
}
return 0;