一、中断优先级分组
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
#define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority
4 bits for subpriority */
#define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority
3 bits for subpriority */
#define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority
2 bits for subpriority */
#define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority
1 bits for subpriority */
#define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority
0 bits for subpriority */
二、概念
?
1. 组0就是4位都用来设置成响应优先级,2^4=16位都是响应优先级。
2. 组1分为(2^1)两个抢占优先级,在这两个抢占优先级里面还分别有(2^3)八个响应优先级,(2^1) *?(2^3) =16
3.?组1分为(2^2)四个抢占优先级,在这四个抢占优先级里面还分别有(2^2)四个响应优先级,(2^2) *?(2^2) =16
4.?组1分为(2^3)八个抢占优先级,在这八个抢占优先级里面还分别有(2^1)两个响应优先级,(2^3) *?(2^1) =16
5.?组1分为(2^4)十六个都是抢占优先级? (2^4) =16
?
|