电子科技 ›› 2021, Vol. 34 ›› Issue (9): 7-11.doi: 10.16180/j.cnki.issn1007-7820.2021.09.002

• • 上一篇    下一篇

优化的μC/OS-III实时内核中断管理机制

冯冲1,2,吴尧辉1,2,吴昊珍3   

  1. 1.河南理工大学 电气工程与自动化学院,河南 焦作 454150
    2.河南理工大学 许继电气股份有限公司煤矿井下智能供电系统实验室,河南 焦作 454150
    3.郑州工商学院,河南 郑州 451400
  • 收稿日期:2020-05-23 出版日期:2021-09-15 发布日期:2021-09-08
  • 作者简介:冯冲(1994-),男,硕士研究生。研究方向:微机嵌入式综保研究开发。吴尧辉(1964-),男,高级工程师。研究方向:嵌入式应用开发。
  • 基金资助:
    国家自然科学基金(61340015);教育部协同育人实践条件建设项目(201702064052);河南省教育厅自然科学研究计划(2010A470003);教育部协同育人创新创业联合基金(201802060039)

Optimizing the Real-Time Kernel Interrupt Management Mechanism of μC/OS-III

FENG Chong1,2,WU Yaohui1,2,WU Haozhen3   

  1. 1. School of Electrical Engineering and Automation,Henan Polytechnic University,Jiaozuo 454000,China
    2. XJ Electric Co., Ltd.,Intelligent Power Supply System for Underground Coal Mine,Henan Polytechnic University,Jiaozuo 454000,China
    3. Zhengzhou Technology and Business University,Zhengzhou 451400,China
  • Received:2020-05-23 Online:2021-09-15 Published:2021-09-08
  • Supported by:
    National Natural Science Foundation of China(61340015);Ministry of Education Collaborative Education Practical Conditions Construction(201702064052);Henan Provincial Department of Education Natural Science Research(2010A470003);Joint Funds of Cooperative Education Innovation and Entrepreneurship of Ministry of Education(201802060039)

摘要:

针对μC/OS-III实时操作系统中,低优先级中断任务对紧急任务截止期干扰较大的问题,文中提出了一种优化的μC/OS-III中断管理机制。利用完全基于μC/OS-III优先级剥夺原则,对中断任务和普通任务的优先级进行统一分配。根据中断的紧急程度为中断任务分配合适的优先级,对比中断任务与当前执行任务的优先级高低来选择不同的处理方式,若中断任务的优先级低于当前执行任务则以任务方式处理,反之则以中断服务程序处理。理论分析和μC/Probe软件检测及实验表明,优化后的μC/OS-III实时内核中断管理机制可以缩短紧急任务的截止期,系统能够可靠稳定地运行,具有较高的实时性。

关键词: μC/OS-III实时操作系统, 中断管理机制, 低优先级中断, 紧急任务, 截止期, 统一分配, μC/Probe, 实时性

Abstract:

In the μC/OS-III real-time operating system, low priority interrupt task has greater interference with the deadline of urgent tasks. In view of this problem, an optimized interrupt management mechanism of μC/OS-III is proposed. Using the principle of priority deprivation based on μC/OS-III, the priority of interrupt task and common task is assigned uniformly. According to the urgency of the interrupt, the interrupt task is assigned an appropriate priority, and different processing methods are selected by comparing the priority of the interrupt task and the current executing task. If the priority of the interrupt task is lower than the currently executing task, it will be processed in task mode, otherwise it will be processed in the interrupt service routine. Theoretical analysis and μC/Probe software testing and experiments show that the optimized μC/OS-III real-time kernel interrupt management mechanism can shorten the deadline of emergency tasks, and the system can run reliably and stably with high real-time performance.

Key words: μC/OS-III real time operating system, interrupt management, low priority interrupt, urgent task, deadline, unity distribution, μC/Probe, real time

中图分类号: 

  • TP311