preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: zelea2 on February 01, 2018, 01:39:26 AM

Title: priority bits
Post by: zelea2 on February 01, 2018, 01:39:26 AM
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.
Title: Re: priority bits
Post by: Xavier on February 02, 2018, 08:21:53 AM

In the current design, the only important priority is the interuption that feeds the DAC from what i remember.
Title: Re: priority bits
Post by: zelea2 on February 02, 2018, 08:49:23 PM
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.