[STM32F1]

系统默认是哪组

[复制链接]
355|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

粉丝