完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
请问如何设置中断优先? void IntPrioritySet(uint32_t ui32Interrupt, uint8_t ui8Priority),这个函数怎么用?参数分别是什么?大神可否给个例子?谢谢
|
|
相关推荐
10 个讨论
|
|
Evawang 发表于 2018-8-16 06:24 Parameters: ui32Interrupt specifies the interrupt in question. ui8Priority specifies the priority of the interrupt. Description: This function is used to set the priority of an interrupt. 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. The hardware priority mechanism only looks at the upper N bits of the priority level (where N is 3 for the Tiva C and E Series family), so any prioritization must be performed in those bits. The remaining bits can be used to sub-prioritize the interrupt sources, and may be used by the hardware priority mechanism on a future part. This arrangement allows priorities to migrate to different NVIC implementations without changing the gross prioritization of the interrupts. 请问是这个吗?这个还是不很明白ui8Priority怎么用。例子好像是 // The interrupt handler function. // extern void IntHandler(void); // // Register the interrupt handler function for interrupt 5. // IntRegister(5, IntHandler); // // Enable interrupt 5. // IntEnable(5); // // Enable interrupt 5. // IntMasterEnable(); 我的是SW-TM4C-DRL-UG-2.0.1.11577这个版本,莫非孙工的2.1.0.12573有中断优先级的描述? |
|
|
|
|
|
|
|
nnbbbbb 发表于 2018-8-16 06:36 你不是已经贴出来了吗? Smaller numbers correspond to higher interrupt priorities; priority 0 is the highest interrupt priority. 翻译过来: 小的数字相当于高的优先级。0是最高的优先级。 还有一句话,The hardware priority mechanism only looks at the upper N bits of the priority level (where N is 3 for the Tiva C and E Series family) 也就是说3bit数据来表征优先级,就是共8个优先级。. 也都有宏定义。 你的例子哪里来的? 2.1.0.12573文档的360页: Example: Set priorities for UART 0 and USB interrupts. // // 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); |
|
|
|
|
|
|
|
nnbbbbb 发表于 2018-8-16 06:36 Datasheet中也有关于优先级更加详细的描述,感兴趣可以去翻看一下。 |
|
|
|
|
|
|
|
|
IntPrioritySet(uint32_t ui32Interrupt, uint8_t ui8Priority)[ uint32_t ui32Temp; // // Check the arguments. // ASSERT((ui32Interrupt >= 4) && (ui32Interrupt < NUM_INTERRUPTS)); // // Set the interrupt priority. // ui32Temp = HWREG(g_pui32Regs[ui32Interrupt >> 2]); ui32Temp &= ~(0xFF << (8 * (ui32Interrupt & 3))); ui32Temp |= ui8Priority << (8 * (ui32Interrupt & 3)); HWREG(g_pui32Regs[ui32Interrupt >> 2]) = ui32Temp;]你对着寄存器看看就知道了 |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
549 浏览 0 评论
1613 浏览 0 评论
2047 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1513 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1337 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1756浏览 29评论
2781浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1723浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1634浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1645浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 00:38 , Processed in 0.844904 second(s), Total 74, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3272