当前位置:网站首页>Zephyr learning notes 1, threads
Zephyr learning notes 1, threads
2022-07-04 07:22:00 【mayiQX】
Starting Today Zephyr Study , Target board nrf9160.
Chapter one : How to create threads (thread).
1.K_THREAD_DEFINE() API
K_THREAD_DEFINE(name, stack_size, entry, p1, p2, p3, prio, options, delay)
Parameters:
name – Name of the thread.
stack_size – Stack size in bytes.
entry – Thread entry function.
p1 – 1st entry point parameter.
p2 – 2nd entry point parameter.
p3 – 3rd entry point parameter.
prio – Thread priority.
options – Thread options.
delay – Scheduling delay (in milliseconds), zero for no delay.
2.Thread Priorities are divided into collaborative and preemptive
Collaborative 0, Preemptive 0.
3. Create and use thread
#define STACKSIZE 1024
#define THREAD0_PRIORITY 7
#define THREAD1_PRIORITY 7
void thread0(void)
{
}
void thread1(void)
{
}
/* Define and initialize the two threads */
K_THREAD_DEFINE(thread0_id, STACKSIZE, thread0, NULL, NULL, NULL,
THREAD0_PRIORITY, 0, 0);
K_THREAD_DEFINE(thread1_id, STACKSIZE, thread1, NULL, NULL, NULL,
THREAD1_PRIORITY, 0, 0);
边栏推荐
- Summary of MySQL common judgment functions!! Have you used it
- Finishing (III) - Exercise 2
- Rhcsa day 3
- Literature collation and thesis reading methods
- Zephyr 學習筆記2,Scheduling
- Novel website program source code that can be automatically collected
- 在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
- Implementation of ZABBIX agent active mode
- 节点基础~节点操作
- Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
猜你喜欢
NLP-文献阅读总结
响应式移动Web测试题
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
tornado项目之路由装饰器
the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
About how idea sets up shortcut key sets
Zephyr 學習筆記2,Scheduling
Data double write consistency between redis and MySQL
Implementation of ZABBIX agent active mode
随机推荐
The idea of implementing charts chart view in all swiftui versions (1.0-4.0) was born
在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
socket inet_ pton() inet_ Ntop() function (a new network address translation function, which converts the expression format and numerical format to each other. The old ones are inet_aton(), INET_ ntoa
Chapter 1 programming problems
[Flink] temporal semantics and watermark
About how idea sets up shortcut key sets
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
The number of patent applications in China has again surpassed that of the United States and Japan, ranking first in the world for 11 consecutive years
Master-slave replication principle of MySQL database
Status of the thread
[MySQL transaction]
Chain ide -- the infrastructure of the metauniverse
Selenium ide plug-in download, installation and use tutorial
Implementation of ZABBIX agent active mode
【Kubernetes系列】Kubernetes 上安装 KubeSphere
Zephyr study notes 2, scheduling
【FreeRTOS】FreeRTOS學習筆記(7)— 手寫FreeRTOS雙向鏈錶/源碼分析
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
The IP bound to the socket is inaddr_ The meaning of any htonl (inaddr_any) (0.0.0.0 all addresses, uncertain addresses, arbitrary addresses)
MySQL storage engine