[STM32F1] 系统默认是哪组

[复制链接]
659|11
 楼主| spark周 发表于 2018-10-12 20:23 | 显示全部楼层 |阅读模式
我看好多例程里面都没有显式配置NVIC_PriorityGroupConfig(),那系统默认是哪组呢,以stm32f103为例
734774645 发表于 2018-10-12 21:45 | 显示全部楼层
优先级配置啊。默认就是不管啊。
734774645 发表于 2018-10-12 21:45 | 显示全部楼层
默认的当然是你什么都不做。
huanghuac 发表于 2018-10-19 18:22 | 显示全部楼层
默认应该是0啊
zwll 发表于 2018-10-19 18:25 | 显示全部楼层
这个是配置LCD液晶屏的吧,我看好多液晶屏说是用这个借口。
huanghuac 发表于 2018-10-19 18:31 | 显示全部楼层



默认是0
 楼主| spark周 发表于 2018-10-19 18:34 | 显示全部楼层

确实默认为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周 发表于 2018-10-19 19:32 | 显示全部楼层
比如有两个中断,一个中断分组为Group_1,抢占式优先级设置为2,响应优先级设置为1,一个中断分级为Group_0,响应优先级设置为0或2时,这两个中断同时产生中断请求时,系统要处理哪个呢?
songqian17 发表于 2018-10-19 19:37 | 显示全部楼层
默认不分组,也就是抢占优先级为0,响应优先级占4位。
huanghuac 发表于 2018-10-19 19:42 | 显示全部楼层

默认是不分组的。。你可以看手册,里面提到了。
gongche 发表于 2018-10-19 19:46 | 显示全部楼层
默认不分组,抢占优先级为0
 楼主| spark周 发表于 2018-10-19 19:50 | 显示全部楼层

哦,那我就知道怎么回事了,多谢大家,结贴了哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则

821

主题

10121

帖子

4

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