当前位置:网站首页>1284_ Implementation analysis of FreeRTOS task priority acquisition
1284_ Implementation analysis of FreeRTOS task priority acquisition
2022-06-29 08:08:00 【grey_ csdn】
All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
Let's analyze it today FreeRTOS Implementation of the priority acquisition function in , involves 2 Interface , One is uxTaskPriorityGet(), The other is its interrupt safe version uxTaskPriorityGetFromISR().

The implementation of this interface is still very simple , In this implementation, the interrupt is turned off directly , Then get the priority of the task . Why do I need to turn off the interrupt , I think the main reason here is xTask May be NULL, What is required at this time is to obtain the current task priority . If an interrupt occurs , This data may be tampered with .

I have seen several similar macro implementations before , If the incoming handle is empty, it is actually a credential for processing the current task . The task handle itself can be converted to TCB Pointer type , In this way, the priority attribute can be obtained directly .

This is an interrupt safe version , The main processing process is similar to that of the previous interface implementation . The difference is , Since it is ISR in , Then an interrupt has already occurred . This is the time , Firstly, the rationality of interrupt priority is confirmed , But this interface is invalid in my current configuration . next , Not off interrupt , Instead, the interrupt mask is modified to prevent unexpected interrupts . There is no big difference in obtaining the priority attribute value .

This is the implementation of mask modification , When modifying, first make a backup of the original mask , Save the original mask after processing .

The mask saved in the previous step becomes a basis for mask recovery here .

Review this again basepri The function of register , This register sets the minimum priority in the system .ARM The smaller the priority value in, the higher the priority , So this value is set to 80 When , Numerically greater than or equal to 80 The interruption of can not happen .FreeRTOS Able to manage ISR The priority should be the lower segment , Therefore, the setting should exceed the value 80 Of , Or at least equal to 80 Of .
such , The task priority is basically analyzed . The following interface analysis , Continue another day .
边栏推荐
- C actual combat - high configuration version of Snake game design
- code::blocks代码格式化快捷键
- 嵌入式产品防盗版
- Mongodb- connect to the database using the mongo/mongosh command line
- C#Mqtt订阅消息
- js:Array. Reduce cumulative calculation and array consolidation
- C编译器 - 隐式函数声明
- php 清除多维数组里面的空值
- Handle series - install spotbugs and use them quickly
- js异或混淆代码
猜你喜欢

MySQL中有哪些约束?(实例验证)

产品经理应该学习墨刀还是Axure?
![[quantitative investment system] factor processing and installation Talib](/img/33/1b8776a392c37f4d32d3bfbb3f9fd4.png)
[quantitative investment system] factor processing and installation Talib

jsp学习部分

【深度之眼吴恩达机器学习作业班第四期】逻辑回归编程实现

【深度之眼吴恩达机器学习作业班第四期】Linear Regression with One Variable,单变量线性回归

【kerberos】kerberos 认证浅析

Protobuf binary file learning and parsing

友元,静态关键字,静态方法以及对象间的关系

Thread pool operations in cartographer
随机推荐
About the many to many cascading insertion of sqlsugar (the ID of the collection attribute cannot be obtained, so the intermediate table cannot be maintained)
RobotFramework学习笔记:Robot Framework和BrowserLibrary(PlayWright)简介
Reasons why the ext.dic file configured in ES does not take effect
Behaviortree in ros2
数组知识点小结
What does Ali's 211 mean?
编程能力提升方向
Oracle batch insert data - insert ethnic data
C mqtt subscription message
Process communication - Pipeline
搭建jenkins环境并自动关联打包好的工程jar进行自动发布
Binary search tree
Codeforces Round #799 (Div. 4)
关于SqlSugar的多对多的级联插入的问题(无法获取集合属性的id,导致无法维护中间表)
How to share the virtual environment of pycharm to jupyter Lab
Codeforces Round #799 (Div. 4)
SQL Server enable CDC
Should product managers learn from ink knife or Axure?
Protobuf 二进制文件学习及解析
laravel 中 distinct() 的使用方法与去重