Charles Lepple | 2 Nov 2005 18:16
Picon

Re: ePuppy application

On 11/2/05, James Klaas <jklaas <at> comcast.net> wrote:
> On Wed, 2 Nov 2005, Charles Lepple wrote:
> > It sounds like that's what your device is doing, but I'm not sure what
> > you mean about only getting switch values every 3-4 loops. How is that
> > loop structured?
[...]
> So every 3-4 times this loop executes, it reads a switch event, the rest
> of the time it reads zero.  I guess what I mean is that the switches can't
> really be pushed fast enough to cause a result on every loop.  When an
> event is read, it the buffer resets to 0x00

ah, so it's essentially "edge-triggered" (i.e. you can't tell how long
a button is pressed).

You could try using strace to see how long each call really takes,
then insert a usleep() call between loops through the
usb_control_message() call. It's probably going to be a subjective
balance between response-time of your program and general system
responsiveness.

--
- Charles Lepple

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

Gmane