打印

Tiva改变中断优先级的办法和解析

[复制链接]
811|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
xyz549040622|  楼主 | 2016-8-26 18:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
使用void IntPrioritySet(uint32_t ui32Interrupt, uint8_t ui8Priority)函数来设置。

This function is used to set the priority of an interrupt. The ui32Interrupt parameter must be
one of the valid INT_ values listed in Peripheral Driver Library User’s Guide and defined in the
inc/hw_ints.h header file. The ui8Priority parameter specifies the interrupts hardware priority
level of the interrupt in the interrupt controller. When multiple interrupts are asserted simultaneously,
the ones with the highest priority are processed before the lower priority interrupts.
Smaller numbers correspond to higher interrupt priorities; priority 0 is the highest interrupt
priority.

//
// Set the UART 0 interrupt priority to the lowest priority.
//
IntPrioritySet(INT_UART0, 0xE0);
//
// Set the USB 0 interrupt priority to the highest priority.
//
IntPrioritySet(INT_USB0, 0);

注意第二个参数,TM4C的中断优先级有7种,分别是0-7,是由最高三位决定的。优先级数字越大则其优先级越低,也就是说0代表最高优先级。所以最高优先级是0x00,最低优先级是0xE0,1110 0000。

相关帖子

沙发
dirtwillfly| | 2016-8-26 20:23 | 只看该作者

使用特权

评论回复
板凳
vivilzb1985| | 2016-8-27 15:12 | 只看该作者
中断优先级的设计还是蛮重要的,这个可以需合理设计。

使用特权

评论回复
地板
baimiaocun2015| | 2016-8-27 16:30 | 只看该作者
在程序运行过程中不宜改变中断的优先级的设计的。

使用特权

评论回复
5
tongbu2015| | 2016-8-27 16:32 | 只看该作者
中断优先级的设计在程序设计中是非常重要的,关系到程序的运行效率的。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:qq群: 嵌入式系统arm初学者 224636155←← +→→点击-->小 i 精品课全集,21ic公开课~~←←→→点击-->小 i 精品课全集,给你全方位的技能策划~~←←

2696

主题

19141

帖子

103

粉丝