PPC OpenPIC: Polarity and Sense ignored?

Till Straumann strauman at SLAC.Stanford.EDU
Fri Jan 24 03:52:27 UTC 2003


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

> Thanks.
> 
> Kamen
> 
> 






More information about the users mailing list