PPC OpenPIC: Polarity and Sense ignored?

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Fri Jan 24 15:24:33 UTC 2003


Till Straumann writes:
 > Kamen Penev wrote:
 > > In the following excerpt from openpic.c:
 > > 
 > > void openpic_initirq(unsigned int irq, unsigned int pri, unsigned int 
 > > vec, int pol, int sense)
 > > {
 > >    check_arg_irq(irq);
 > >    check_arg_pri(pri);
 > >    check_arg_vec(vec);
 > >    openpic_safe_writefield(&OpenPIC->Source[irq].Vector_Priority,
 > >                    OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
 > >                    OPENPIC_SENSE_POLARITY | OPENPIC_SENSE_LEVEL,
 > >                    (pri << OPENPIC_PRIORITY_SHIFT) | vec |
 > >                (pol ? OPENPIC_SENSE_POLARITY : 0) |
 > >                (sense ? OPENPIC_SENSE_LEVEL : 0));
 > > }
 > > 
 > > the last two arguments of the function (pol and sense) don't seem to 
 > > make any difference, since the value that is being written into the 
 > > vector/priority register is always OR-ed with OPENPIC_SENSE_POLARITY | 
 > > OPENPIC_SENSE_LEVEL.
 > > 
 > > Am I missing something?
 > > 
 > 
 > The comma (separating the second from the third argument), perhaps?
 > 
 > ;-)
 > 
 > -- Till

Wow, you're 2 for 2 so far!

Gregm




More information about the users mailing list