/* Output a string to the usb client port - implementing flow control  */
static void __usbtty_puts(const char *str, int len)
/* Output a string to the usb client port - implementing flow control  */
static void __usbtty_puts(const char *str, int len)
{
	int maxlen = usbtty_output.totalsize;
	int space, n;
	while (len > 0) {
		usbtty_poll ();
		space = maxlen - usbtty_output.size;
		if (space) {
			write_buffer (&usbtty_output);
			n = MIN (space, MIN (len, maxlen));
			buf_push (&usbtty_output, str, n);
			str += n;
			len -= n;
		}
	}
}