当前位置:网站首页>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);边栏推荐
- Enter the year, month, and determine the number of days
- 2022-021rts: from the second half of the year
- Set JTAG fuc invalid to normal IO port
- Chain ide -- the infrastructure of the metauniverse
- Basic DOS commands
- Experience installing VMware esxi 6.7 under VMware Workstation 16
- notepad++如何统计单词数量
- Finishing (III) - Exercise 2
- 关于IDEA如何设置快捷键集
- 响应式——媒体查询
猜你喜欢

Industrial computer anti-virus

How to share the source code anti disclosure scheme

Zephyr study notes 2, scheduling

NLP literature reading summary

Uniapp applet subcontracting

Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
![[Valentine's day] - you can change your love and write down your lover's name](/img/ab/402872ad39f9dc58fd27dd6fc823ef.jpg)
[Valentine's day] - you can change your love and write down your lover's name

MySQL relearn 2- Alibaba cloud server CentOS installation mysql8.0

Handwritten easy version flexible JS and source code analysis

The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
随机推荐
A real penetration test
How to input single quotation marks and double quotation marks in latex?
Selenium ide plug-in download, installation and use tutorial
电子协会 C语言 1级 35 、银行利息
Bottom problem of figure
【Kubernetes系列】Kubernetes 上安装 KubeSphere
Summary of MySQL common judgment functions!! Have you used it
Experience installing VMware esxi 6.7 under VMware Workstation 16
Vulhub vulnerability recurrence 76_ XXL-JOB
Implementation of ZABBIX agent active mode
Zephyr 學習筆記2,Scheduling
Crawler (III) crawling house prices in Tianjin
Finishing (III) - Exercise 2
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
MySQL storage engine
果果带你写链表,小学生看了都说好
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
Transition technology from IPv4 to IPv6
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
Chapter 1 programming problems