Update: Changed my mind, I’ll give the user full control as there is now a function that validate the values of the priorities and sub-priorities regarding the priority group selected.
Hint: Project Settings window has settings for Priority Groups and for the priorities of the pins set as EXTI. Priorities for the “system interrupts” (as SysTick_IRQn and alike) are permanently set at highest priority. Other priorities as I2C, SPI, USART, etc., are set from their setup windows (well, it will be at the next repository commit).
Original article:
Considering that VPC is targeted at newbies, I’ll go with Group Priority 0. ST.M. says about this group:
When NVIC_PriorityGroup_0 is selected, it will be no nested interrupts. The interrupts priority is managed only with subpriority.
And this works just fine in our case. So, we have:
- system interrupts and systick at subpriority 0;
- timer interupts at subpriority 1;
- and I’ll let user choose from subpriority 2 to 15 for other interrupts (this means a slight redesign of the user interface).
