From: Alan Cox Date: Sat, 19 Jan 2019 21:38:29 +0000 (+0000) Subject: pcw8256: static tty buffers and basis for nice tty wakeups later X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5612a206046357d1aa7ef0c7ac6f782f2a26785d;p=FUZIX.git pcw8256: static tty buffers and basis for nice tty wakeups later --- diff --git a/Kernel/platform-pcw8256/devtty.c b/Kernel/platform-pcw8256/devtty.c index f7dca186..caa0c53a 100644 --- a/Kernel/platform-pcw8256/devtty.c +++ b/Kernel/platform-pcw8256/devtty.c @@ -22,9 +22,11 @@ __sfr __at 0xE4 ctc0; __sfr __at 0xE5 ctc1; __sfr __at 0xE7 ctcmode; -char tbuf1[TTYSIZ]; -char tbuf2[TTYSIZ]; -char tbuf3[TTYSIZ]; +static char tbuf1[TTYSIZ]; +static char tbuf2[TTYSIZ]; +static char tbuf3[TTYSIZ]; + +static uint8_t sleeping; struct s_queue ttyinq[NUM_DEV_TTY+1] = { /* ttyinq[0] is never used */ { NULL, NULL, NULL, 0, 0, 0 }, @@ -106,11 +108,19 @@ void tty_irq(void) c = dart0d; tty_inproc(2, c); } + if ((s & 4) && (sleeping & 4)) { + tty_outproc(2); + sleeping &= ~4; + } s = dartrr(3, 0); if (s & 1) { c = dart0d; tty_inproc(2, c); } + if ((s & 4) && (sleeping & 8)) { + tty_outproc(3); + sleeping &= ~8; + } } /* Called to set baud rate etc */ @@ -128,7 +138,7 @@ int tty_carrier(uint8_t minor) void tty_sleeping(uint8_t minor) { - minor; + sleeping |= (1 << minor); } void tty_data_consumed(uint8_t minor)