#include <devtty.h>
#include <rc2014.h>
-char tbuf1[TTYSIZ];
-char tbuf2[TTYSIZ];
+static char tbuf1[TTYSIZ];
+static char tbuf2[TTYSIZ];
+
+static uint8_t sleeping;
uint8_t ser_type = 1;
if (ca & 2)
SIOA_C = 2 << 5;
/* Output pending */
- if (ca & 4) {
+ if ((ca & 4) && (sleeping & 2)) {
tty_outproc(1);
+ sleeping &= ~2;
SIOA_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
/* Carrier changed */
tty_inproc(2, SIOB_D);
progress = 1;
}
- if (cb & 4) {
+ if ((cb & 4) && (sleeping & 4)) {
tty_outproc(2);
+ sleeping &= ~4;
SIOB_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
if ((cb ^ old_cb) & 8) {
/* We will need this for SIO once we implement flow control signals */
void tty_sleeping(uint8_t minor)
{
+ sleeping |= (1 << minor);
}
/* Be careful here. We need to peek at RR but we must be sure nobody else
/* kernel writes to system console -- never sleep! */
void kputchar(char c)
{
- tty_putc(TTYDEV - 512, c);
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
if (c == '\n')
tty_putc(TTYDEV - 512, '\r');
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
+ tty_putc(TTYDEV - 512, c);
}
#include "vfd-term.h"
#include "vfd-debug.h"
-char tbuf1[TTYSIZ];
-char tbuf2[TTYSIZ];
+static char tbuf1[TTYSIZ];
+static char tbuf2[TTYSIZ];
+
+static uint8_t sleeping;
uint8_t ser_type = 1;
if (ca & 2)
SIOA_C = 2 << 5;
/* Output pending */
- if (ca & 4) {
+ if ((ca & 4) && (sleeping & 2)) {
tty_outproc(1);
+ sleeping &= ~2;
SIOA_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
/* Carrier changed */
tty_inproc(2, SIOB_D);
progress = 1;
}
- if (cb & 4) {
+ if ((cb & 4) && (sleeping & 4)) {
tty_outproc(2);
+ sleeping &= ~4;
SIOB_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
if ((cb ^ old_cb) & 8) {
if (ca & 1) {
tty_inproc(1, ACIA_D);
}
- if (ca & 2) {
+ if ((ca & 2) && sleeping) {
tty_outproc(1);
+ sleeping = 0;
}
}
}
}
-/* We will need this for SIO once we implement flow control signals */
void tty_sleeping(uint8_t minor)
{
+ sleeping |= (1 << minor);
}
/* Be careful here. We need to peek at RR but we must be sure nobody else
/* kernel writes to system console -- never sleep! */
void kputchar(char c)
{
- tty_putc(TTYDEV - 512, c);
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
if (c == '\n')
tty_putc(TTYDEV - 512, '\r');
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
+ tty_putc(TTYDEV - 512, c);
}
#include <devtty.h>
#include <rc2014.h>
-char tbuf1[TTYSIZ];
-char tbuf2[TTYSIZ];
+static char tbuf1[TTYSIZ];
+static char tbuf2[TTYSIZ];
+
+static uint8_t sleeping;
uint8_t ser_type = 2;
if (ca & 2)
SIOA_C = 2 << 5;
/* Output pending */
- if (ca & 4) {
+ if ((ca & 4) && (sleeping & 2)) {
tty_outproc(1);
+ sleeping &= ~2;
SIOA_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
/* Carrier changed */
tty_inproc(2, SIOB_D);
progress = 1;
}
- if (cb & 4) {
+ if ((cb & 4) && (sleeping & 4)) {
tty_outproc(2);
+ sleeping &= ~4;
SIOB_C = 5 << 3; // reg 0 CMD 5 - reset transmit interrupt pending
}
if ((cb ^ old_cb) & 8) {
ca = ACIA_D;
tty_inproc(1, ca);
}
- if (ca & 2) {
-// We don't use IRQ driven tty_outproc(1);
+ if ((ca & 2) && sleeping) {
+ tty_outproc(1);
+ sleeping = 0;
}
}
/* kernel writes to system console -- never sleep! */
void kputchar(char c)
{
- tty_putc(TTYDEV - 512, c);
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
if (c == '\n')
tty_putc(TTYDEV - 512, '\r');
+ while(tty_writeready(TTYDEV - 512) != TTY_READY_NOW);
+ tty_putc(TTYDEV - 512, c);
}