Showroom USI example: parallel port

Hannes Mayer h.mayer at inode.at
Sat Oct 9 12:55:43 CEST 2004


Hannes Mayer wrote:
> Paolo Mantegazza wrote:
>  > man ioperm, man iopl, at your choice.
> 
> Hi Paolo!
> 
> I always used #include <asm/io.h>, but #include <sys/io.h> seems to do
> the trick. Thank you for the reminder to look into "man ioperm" again :-)
> 
> I managed to detect one interrupt, but after that no further interrupt is
> detected.
> 
> Here is the while-loop in the thread of the USI example:
> 
> [...]
> while (!end) {
>     do {
>         //ovr = rt_wait_intr_timed(intsem, nano2count(TIMEOUT), (void 
> *)&retval);
>         ovr = rt_wait_intr(intsem, (void *)&retval);
>         hard_sti();
>         if (end) break;
>         if (ovr > 0) {                    // overrun processing, if any, 
> goes here
>             rt_sem_signal(dspsem);
>         }
>         /* normal processing goes here */
>         intcnt++;
>         rt_sem_signal(dspsem);
>         rt_ack_irq(PARPORT_IRQ);
>     } while (ovr > 0);
>     rt_pend_linux_irq(PARPORT_IRQ);
> }
> [...]
> 
> With some printf's I found that the first interrupt is detected, the 
> loop proceeds
> to rt_pend_linux_irq, starts over again, but then it hangs at 
> rt_wait_intr and no
> further interrupt is detected.
> I already added rt_ack_irq, which I use in my kernel modules, but that 
> doesn't work
> in this case.
> 
> What else must be done to detect further parallel port interrupts in 
> user-space ?

Forgot to mention that I've tried putting
rt_startup_irq(PARPORT_IRQ);
and/or
rt_enable_irq(PARPORT_IRQ);
and/or
rt_ack_irq(PARPORT_IRQ);
and/or
rt_unmask_irq(PARPORT_IRQ);
into the thread loop at various places, the main loop etc., but still no
luck.

Well, so far I find kernel modules much easier to make, but since Paolo
told us to try to concentrate on LXRT, I'm up for the challange :-)

Best regards,
Hannes.






More information about the Rtai mailing list