PreenFM > preenfm2 and preenfm3

priority bits

(1/1)

zelea2:
In the git code I've noticed that __NVIC_PRIO_BITS is not defined so it stays at its default value of 4
This means 4 bits for the PreemptionPriority and none for the SubPriority

Then in various places in the code both ChannelPreemptionPriority and ChannelSubPriority are
initialized with non zero values. Obviously the ChannelSubPriority has no effect and stays at zero.

One only needs sub-priority when several interrupts with the same preemption are pending then the
sub-priority decides which one is served first.

Xavier:

In the current design, the only important priority is the interuption that feeds the DAC from what i remember.

zelea2:
Setting the sub-priority in the above context can be considered a (harmless) bug. It's at least confusing when you read the code so I think it's worth placing a zero or remove the lines initializing the sub-priority.

Navigation

[0] Message Index

Go to full version