当前位置:网站首页>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);边栏推荐
- Su Weijie, a member of Qingyuan Association and an assistant professor at the University of Pennsylvania, won the first Siam Youth Award for data science, focusing on privacy data protection, etc
- Implementation of ZABBIX agent active mode
- Zephyr 学习笔记2,Scheduling
- 节点基础~节点操作
- 电脑通过Putty远程连接树莓派
- [Chongqing Guangdong education] National Open University spring 2019 770 real estate appraisal reference questions
- Chapter 1 programming problems
- Blue Bridge Cup Quick sort (code completion)
- Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
- Summary of MySQL common judgment functions!! Have you used it
猜你喜欢

How notepad++ counts words

There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method

CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions

Mobile adaptation: vw/vh

在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
![[Mori city] random talk on GIS data (I)](/img/e4/2a2ceb10a2c0285cdd0c922f827930.png)
[Mori city] random talk on GIS data (I)

Handwritten easy version flexible JS and source code analysis

BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment

Vulhub vulnerability recurrence 77_ zabbix

Technical experts from large factories: common thinking models in architecture design
随机推荐
The difference between synchronized and lock
在已经知道表格列勾选一个显示一列
tornado项目之路由装饰器
[untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
云Redis 有什么用? 云redis怎么用?
MySQL storage engine
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
Vulhub vulnerability recurrence 76_ XXL-JOB
节点基础~节点操作
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
响应式移动Web测试题
Status of the thread
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
BibTex中参考文献种类
Introduction to rce in attack and defense world
Mobile adaptation: vw/vh
There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
About how idea sets up shortcut key sets
Uniapp applet subcontracting
Docker install MySQL