Re: [PARPORT] searching example for ppdev and interupt

From: norman (norman@elbestrom.boerde.de)
Date: Wed Feb 27 2002 - 10:19:22 EST

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

    > Port detection (including /proc parsing) done for you, proper IEEE
    > 1284 signal names instead of PC-style inverted ones, seemless use of
    > direct I/O or /dev/port if /dev/parport* isn't available, possibility
    i dont realy need this because my lpt ports are running fine with ppdev:

    parport0: PC-style at 0x278, irq 9 [PCSPP]
    parport1: PC-style at 0x378, irq 7 [PCSPP,EPP]
    parport2: PC-style at 0x3bc, irq 10 [PCSPP]

    > of working on other POSIX platforms, slightly better interface,
    > slightly better documentation.
    cant find any documentation in the tarball ;)

    to my interupt-problem. ive the following pice of code. when i start
    the program and trigger the ack line (pin 10) (shortcut pin 10 with ground),
    the syslog says: spurious 8259A interrupt: IRQ7.
    but my program didnt prints out printf("Got an INT\n");
    do you know what iam making wrong ?

        int irqc;
        int nAck = PARPORT_STATUS_ACK;
        int nFault = PARPORT_STATUS_ERROR;
        int bussy = PARPORT_STATUS_BUSY;
        
        int busy = nAck | nFault;
        int acking = nFault;
        int ready = busy | nAck | nFault;
        char ch;

        fd = claimdev(argv[1]);

        ioctl (fd, PPWCTLONIRQ, &busy);

        ioctl (fd, PPWCONTROL, &ready);

        for (;;) {
          fd_set rfds;
          FD_ZERO (&rfds);
          FD_SET (fd, &rfds);
          if (!select (fd + 1, &rfds, NULL, NULL, NULL))
            printf("Got an INT\n");
        
        }

    }

    Norman.

    -- 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 : Wed Feb 27 2002 - 10:21:10 EST