/* I write to the keyboard without using interrupts, I poll instead. This takes for the maximum length string allowed (7) at 7812.5 baud 8 data 1 start 1 stop bit: 9.0 ms If this takes too long for normal operation, interrupt driven writing is the solution. (I made a feeble attempt in that direction but I kept it simple for now.)  */
void ikbd_write(const char *str, int len)
/* I write to the keyboard without using interrupts, I poll instead. This takes for the maximum length string allowed (7) at 7812.5 baud 8 data 1 start 1 stop bit: 9.0 ms If this takes too long for normal operation, interrupt driven writing is the solution. (I made a feeble attempt in that direction but I kept it simple for now.)  */
void ikbd_write(const char *str, int len)
{
	u_char acia_stat;
	if ((len < 1) || (len > 7))
		panic("ikbd: maximum string length exceeded");
	while (len) {
		acia_stat = acia.key_ctrl;
		if (acia_stat & ACIA_TDRE) {
			acia.key_data = *str++;
			len--;
		}
	}
}