[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: pending interrupts
From:       Nicolas Pitre <nico () cam ! org>
Date:       2004-09-14 17:04:26
Message-ID: Pine.LNX.4.61.0409141259370.12375 () xanadu ! home
[Download RAW message or body]

On Tue, 14 Sep 2004, Matthias Welwarsky wrote:

> On Tuesday 14 September 2004 16:26, Nicolas Pitre wrote:
> > On Tue, 14 Sep 2004, Hinko Kocevar wrote:
> > > Russell King - ARM Linux wrote:
> > > > Why do you think you don't need this?
> > >
> > > I coded driver for rotary pulse generator (RPG)- potentiometer like piece
> > > of hardware that connects to two gpio pins, and generates pulses on both
> > > pins according to direction being rotated. For detection of pulses and
> > > consequently detection of turning direction I used those two pins as
> > > interrupts. It works fine, but as I said, if interrupts are pending there
> > > are some unwanted effects. Eg. Turning the RPG causes value displayed on
> > > LCD to change, what I don't want is value changing after I stop turning
> > > it - which is the effect of pending interrupts accumulated.
> > >
> > > Maybe there is another way to handle this?
> >
> > This looks like a perfect fit for a FIQ handler to me, given you're
> > using GPIOs which interrupts aren't multiplexed on the same IRQ.
> 
> Well, yes, but it's rather difficult to communicate things from an FIQ 
> handler. You'll have to queue decoded events in the FIQ and poll the queue in 
> a regular timer handler every now and then. 

It doesn't mean that's not the proper and actually the only guaranteed 
reliable way to do it. Life isn't always easy.

> Also, it's a little difficult to 
> write the FIQ code in C, since you lack a stack :)

FIQ handlers are always written in assembly, of course.


Nicolas

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic