/*
 * Copyright(C) Paul und Scherer (mct.de/mct.net)
 *
 * This example demonstrates how to...
 *
 *  ... change the baudrate for stdin/stdout/stderr.
 *
 *  ... set interrupt mode for stdin.
 */

#include <stdio.h>
#include "tty.h"

void perror();

#define BAUD	9600

/*
 * stdin/stdout/stderr use TTY0 and so share the
 * same baudrate. Changing the baudrate for TTY0
 * changes the baudrate for all std I/O.
 */
int
main(void)
{
	/*
	 * Set TTY0 baudrate and receiver interrupt mode.
	 *
	 * On error, tty_init() returns non-zero and sets
	 * errno appropriately.
	 */
	if (tty_init("tty0", BAUD, 1)) return perror("tty_init"), 1;

	while (1) puts("hello..."), getchar();
}

