Author Topic: priority bits  (Read 5562 times)

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
priority bits
« 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.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: priority bits
« Reply #1 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.

zelea2

  • Team member
  • *
  • Posts: 38
    • View Profile
Re: priority bits
« Reply #2 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.