[STM32F1] 系统默认是哪组

[复制链接]
1043|13
 楼主| spark周 发表于 2017-8-27 18:00 | 显示全部楼层 |阅读模式
我看好多例程里面都没有显式配置NVIC_PriorityGroupConfig(),那系统默认是哪组呢,以stm32f103为例
wyjie 发表于 2017-8-27 18:02 | 显示全部楼层
默认应该是0啊
yszong 发表于 2017-8-27 18:03 | 显示全部楼层
这个是配置LCD液晶屏的吧,我看好多液晶屏说是用这个借口。
heweibig 发表于 2017-8-27 18:05 | 显示全部楼层


默认是0
 楼主| spark周 发表于 2017-8-27 18:06 | 显示全部楼层

确实默认为0,
#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 */

#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
                                       ((GROUP) == NVIC_PriorityGroup_1) || \
                                       ((GROUP) == NVIC_PriorityGroup_2) || \
                                       ((GROUP) == NVIC_PriorityGroup_3) || \
                                       ((GROUP) == NVIC_PriorityGroup_4))

我在里面看到了
 楼主| spark周 发表于 2017-8-27 18:09 | 显示全部楼层

还有个问题,默认为0时,那所有4位都用来设置响应优先级,抢占式优先级那不设置不了吗?
jiaxw 发表于 2017-8-27 18:10 | 显示全部楼层

抢占式优先级怎么算
 楼主| spark周 发表于 2017-8-27 18:11 | 显示全部楼层

比如有两个中断,一个中断分组为Group_1,抢占式优先级设置为2,响应优先级设置为1,一个中断分级为Group_0,响应优先级设置为0或2时,这两个中断同时产生中断请求时,系统要处理哪个呢?
zhaoxqi 发表于 2017-8-27 18:12 | 显示全部楼层

默认不分组,也就是抢占优先级为0,响应优先级占4位。
 楼主| spark周 发表于 2017-8-27 18:13 | 显示全部楼层

哦,那我就知道怎么回事了,多谢大家,结贴了哈
lwsn 发表于 2017-8-29 17:34 | 显示全部楼层
默认不分组的
feelhyq 发表于 2017-8-29 17:39 | 显示全部楼层
zhaoxqi 发表于 2017-8-27 18:12
默认不分组,也就是抢占优先级为0,响应优先级占4位。

mintspring 发表于 2017-8-29 19:59 | 显示全部楼层
默认是不分组的。。你可以看手册,里面提到了。
Mattheww 发表于 2017-8-31 16:43 | 显示全部楼层
默认不分组,抢占优先级为0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

821

主题

10121

帖子

4

粉丝
快速回复 在线客服 返回列表 返回顶部