Re: [PARPORT] searching example for ppdev and interupt

From: Tim Waugh (twaugh@redhat.com)
Date: Tue Feb 26 2002 - 09:52:01 EST

  • Next message: norman: "Re: [PARPORT] searching example for ppdev and interupt"

    On Tue, Feb 26, 2002 at 03:43:50PM +0100, norman wrote:

    > > I think there is an example of just that at
    > > <http://cyberelk.net/tim/parport/html/>.
    >
    > /* Set up the control lines when an interrupt happens. */
    > ioctl (fd, PPWCTLONIRQ, &busy);
    >
    > /* Now we're ready. */
    > ioctl (fd, PPWCONTROL, &ready);
    >
    >
    >
    > /* Wait for an interrupt. */
    > {
    > fd_set rfds;
    > FD_ZERO (&rfds);
    > FD_SET (fd, &rfds);
    > if (!select (fd + 1, &rfds, NULL, NULL, NULL))
    > /* Caught a signal? */
    > continue;
    > }
    >
    > so (!select (fd + 1, &rfds, NULL, NULL, NULL) is true if an int was send ?

    No, false. An 'exception' is marked on the file descriptor (see the
    man page for select or poll). Then use PPCLRIRQ to find out how many
    interrupts were seen.

    Tim.
    */



    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Tue Feb 26 2002 - 09:54:15 EST