当前位置:网站首页>1292_ Implementation analysis of vtask resume() and xtask resume fromisr() in freeros
1292_ Implementation analysis of vtask resume() and xtask resume fromisr() in freeros
2022-07-06 21:39:00 【grey_ csdn】
All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
Today, let's look at a relatively simple interface implementation ,vTaskResume() The implementation of the . It may be that the interface analyzed above has some precipitation , It's really not difficult to see this interface implementation this time , After all, the interface implementation involved in it has been analyzed before .


Many interfaces in the software actually don't work in my current configuration , So the rest of the code itself is not much .
Interface at the beginning , The way of assertion determines the validity of the task handle . Actually , With this , The state of one of the following conditions is confirmed , The later judgment is a little redundant when the assertion is on . The most basic judgment is to see whether the pending task handle is the handle of the current task , If it is , This operation is also meaningless . Because the current task is running , It will not be suspended ,
The basic prerequisites for processing have been met , The next step is to resume the suspended task . Of course , First of all, you have to confirm that the task is suspended . If it is , Remove from the pending task list , Then add it to the ready task list . such , The basic treatment is almost done .
If the scheduler is preemptive , At this time, we have to see whether the priority of the restored task is higher than that of the running task . If it is , That means you need to switch tasks .
This is the implementation of this interface , Relatively simple .

Look at the interruption of the safe version API, First, the validity of the handle is judged , Secondly, I looked at the effectiveness of interrupt priority . There is no need to judge the current execution Task The relationship between , Because in ISR in , Whether the scheduling is running or not is unknown .

Next , The overall treatment is the same as vTaskResume() Little difference , The only difference is the processing when the scheduler hangs .vTaskResume() Execution is in OS The scheduling code of , Therefore, the scheduler must not be suspended . But in ISR in , This is not necessarily , The state of the scheduler may be different . therefore , There is an additional scheduler pending processing .
边栏推荐
- Sequoia China, just raised $9billion
- Description of web function test
- Sql: stored procedures and triggers - Notes
- Is this the feeling of being spoiled by bytes?
- Why does MySQL index fail? When do I use indexes?
- JS method to stop foreach
- Redistemplate common collection instructions opsforhash (IV)
- 038. (2.7) less anxiety
- ACdreamoj1110(多重背包)
- 代理和反向代理
猜你喜欢

Numpy download and installation

uni-app App端半屏连续扫码

3D人脸重建:从基础知识到识别/重建方法!

Michael smashed the minority milk sign

C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果

【力扣刷题】一维动态规划记录(53零钱兑换、300最长递增子序列、53最大子数组和)
![[interpretation of the paper] machine learning technology for Cataract Classification / classification](/img/0c/b76e59f092c1b534736132faa76de5.png)
[interpretation of the paper] machine learning technology for Cataract Classification / classification

爬虫实战(五):爬豆瓣top250

麦趣尔砸了小众奶招牌

Efficiency tool +wps check box shows the solution to the sun problem
随机推荐
ViT论文详解
Sdl2 source analysis 7: performance (sdl_renderpresent())
JS学习笔记-OO创建怀疑的对象
Guava: three ways to create immutablexxx objects
Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
Quick access to video links at station B
Start the embedded room: system startup with limited resources
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
R language for text mining Part4 text classification
c语言char, wchar_t, char16_t, char32_t和字符集的关系
This year, Jianzhi Tencent
Description of web function test
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
14 years Bachelor degree, transferred to software testing, salary 13.5k
Reflection operation exercise
What's the best way to get TFS to output each project to its own directory?
Redistemplate common collection instructions opsforzset (VI)
语谱图怎么看
Caching strategies overview