/* Read a single byte from the usb client port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int usbtty_getc(struct stdio_dev *dev)
/* Read a single byte from the usb client port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int usbtty_getc(struct stdio_dev *dev)
{
	char c;
	struct usb_endpoint_instance *endpoint =
		&endpoint_instance[rx_endpoint];
	while (usbtty_input.size <= 0) {
		udc_unset_nak(endpoint->endpoint_address&0x03);
		usbtty_poll ();
	}
	buf_pop (&usbtty_input, &c, 1);
	udc_set_nak(endpoint->endpoint_address&0x03);
	return c;
}