public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bodonoghue@codehermit.ie>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] PXA27x usbtty start up sequence
Date: Sun, 20 May 2007 14:54:36 +0100	[thread overview]
Message-ID: <20070520145436.180807c6@localhost.localdomain> (raw)
In-Reply-To: <20070518171521.GA4199@enneenne.com>

On Fri, 18 May 2007 19:15:21 +0200
Rodolfo Giometti <giometti@enneenne.com> wrote:

> > /* Not tested */
> > unsigned int len = 0;
> > while(len > 0) {
> > 	usbtty_poll();
> > 
> > 	/* Do stuff */
> > }
> > 
> > in __usbtty_puts()
> 
> No, this doesn't resolve the problem.

That's really quite odd. The following should be similar to what you
did and it *does* seem to work just fine, for me.

/*
 * 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, retries = 0;

	/* break str into chunks < buffer size, if needed */
	while (len > 0 && retries < 10000L) {
		usbtty_poll ();

		space = maxlen - usbtty_output.size;
		/* Empty buffer here, if needed, to ensure space... */
		if (space) {
			write_buffer (&usbtty_output);
			
			n = MIN (space, MIN (len, maxlen));
			buf_push (&usbtty_output, str, n);

			str += n;
			len -= n;
			retries = 0;		
		}else{
			retries++;
		}
	}
}

Das U-Boot environment:
stdin usbtty
stdout usbtty
usbtty cdc_acm


Best,
Bryan

  reply	other threads:[~2007-05-20 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-12 23:19 [U-Boot-Users] PXA27x usbtty start up sequence Rodolfo Giometti
2007-05-13 12:25 ` Bryan O'Donoghue
2007-05-14  6:35   ` Rodolfo Giometti
2007-05-18 17:15   ` Rodolfo Giometti
2007-05-20 13:54     ` Bryan O'Donoghue [this message]
2007-05-20 16:07       ` Rodolfo Giometti
2007-05-20 21:40         ` Bryan O'Donoghue
2007-05-20 22:23           ` Rodolfo Giometti
2007-05-20 23:11             ` Bryan O'Donoghue
2007-05-20 23:59               ` Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070520145436.180807c6@localhost.localdomain \
    --to=bodonoghue@codehermit.ie \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox