当前位置:网站首页>1288_ Implementation analysis of vtask resume() interface and interrupt Security version interface in FreeRTOS
1288_ Implementation analysis of vtask resume() interface and interrupt Security version interface in FreeRTOS
2022-07-02 18:02:00 【grey_ csdn】
All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
The interface analysis in recent times may be relatively simple projects , The analysis went smoothly . Of course , It is also possible that the information read before has reached a certain amount, which is helpful for understanding these interfaces now .
This time, , Then analyze a simple interface vTaskResume().
It is worth noting that the above pretreatment , In fact, it is the same condition as the previous preprocessing of the interface that suspends tasks . The two processes have a little reverse meaning , It is also easy to understand why it exists at the same time .
Actually , Whether it exists at the same time is not very critical . The more valuable information for me is , These functions are actually not used in some projects I have been in contact with , Therefore, making modifications in this regard should ensure OS Cut to smaller size .
Back to the design and analysis of software code itself , First of all, it is judged here that the task to be resumed exists . In general , If the processing handle for the task is NULL It is usually the default to handle the current task , But this operation is not tenable in rationality analysis . therefore , A check assertion like this is added here .
The later part of the code is actually relatively simple , A very important point is that this operation should not deal with the current task . Because the current task must be running , If you want to do such a treatment, it must be meaningless . because , There is no possibility of suspending the currently running task . Another thing to note is the priority of the restored task , Because the task readiness with high priority may involve the processing of task scheduling .
About the task processing that really needs to be restored , First of all, the task is removed from the suspended list , Then add it to the ready task list . After adding , Determine the priority of the recovery task , After comparing with the current task priority, you can know whether the request processing of task scheduling is required next . Finally, handle the task scheduling request .
Interrupt the safe version of and normal API The main difference in processing lies in 2 spot . First of all , Interrupt the shielding of the Security version OS Interruption of custody ISR, Prevent interference . Another point , In fact, the suspension of processing tasks in interrupts does not need to consider whether the scheduler is suspended , In fact, they can be suspended , Even the current task. therefore , The task handle passed in is just to see if it is valid , I didn't judge whether it was a task being processed . And for the scheduler to hang , There is an extra linked list for temporary buffer , When the scheduler resumes, transfer the task to the ready task list .
边栏推荐
- wait_for_gap -- 从主库归档备库恢复归档
- Aloam code reading and summary
- Taiwan Feiling fm8pb513b MCU provides MCU program development product design
- 透过华为军团看科技之变(六):智慧公路
- Solution pour arrêter automatiquement les paquets Jar en cours d'exécution en éteignant le serveur de connexion xshell
- 应广单片机开发调试应注意的问题
- 【Golang | gRPC】使用gRPC实现简单远程调用
- Alibaba cloud sub account - Permission Policy - full control permission granted to an account and an OSS bucket
- 977. Square of ordered array
- 蓝牙技术|物联网的可穿戴设备新工作模式,蓝牙BLE助力新工作模式
猜你喜欢
售价仅40元,树莓派Pico开发板加入WiFi模块,刚上市就脱销
wait_ for_ Gap -- restore archive from primary archive to secondary Archive
开发一个禁止删除namespace的控制器
如何开启IDEA的Run Dashboard功能
Pfc232-sop8/14/16 should be wide-ranging and can be tape programmed with burning program
wps插入图片后使图片完整显示
From a professional background, I can't get into a small company for interview
ORA-19838 -- 恢复控制文件到备库
[how is the network connected] Chapter 6 requests arrive at the server and respond to the client (end)
一个优秀程序员可抵五个普通程序员!
随机推荐
能解决 80% 故障的排查思路
Editor编辑器扩展在Scene View添加按钮和logo
Taiwan Feiling fm8pb513b MCU provides MCU program development product design
Embedded ~ introduction
Yingguang single chip microcomputer development specification pmc131 with AD chip to detect battery voltage single chip microcomputer sop8/14
977. Square of ordered array
uva1169
详解Kubernetes网络模型
ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
Freemaker+poi realizes dynamic generation and parsing of Excel files
[nonlinear control theory]8_ Comparison of three robust controllers
把xshell連接服務器關掉,運行的jar包就自動停止的解决方案
Develop a controller that prohibits deleting namespaces
515. 在每个树行中找最大值
ORA-19838 -- 恢复控制文件到备库
Virtual lab basic experiment tutorial -7 Polarization (2)
Huimang micro IO MCU ft60f010a-urt
Outsourcing for five years, abandoned
My creation anniversary
vimium映射鍵