当前位置:网站首页>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);边栏推荐
- Zephyr Learning note 2, Scheduling
- Knowledge payment applet dream vending machine V2
- 电子协会 C语言 1级 34 、分段函数
- 大厂技术专家:架构设计中常用的思维模型
- A new understanding of how to encrypt industrial computers: host reinforcement application
- 【GF(q)+LDPC】基于二值图GF(q)域的规则LDPC编译码设计与matlab仿真
- Latex中的单引号,双引号如何输入?
- 【Kubernetes系列】Kubernetes 上安装 KubeSphere
- [web security] nodejs prototype chain pollution analysis
- There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
猜你喜欢

Pangu open source: multi support and promotion, the wave of chip industry

Handwritten easy version flexible JS and source code analysis

Implementation of ZABBIX agent active mode

Crawler (III) crawling house prices in Tianjin
![[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)](/img/5c/afb0d43665a8b46579dc604d983790.jpg)
[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)

Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)

Chain ide -- the infrastructure of the metauniverse

Introduction to spark core components

Master-slave replication principle of MySQL database
![[Mori city] random talk on GIS data (I)](/img/e4/2a2ceb10a2c0285cdd0c922f827930.png)
[Mori city] random talk on GIS data (I)
随机推荐
What is the use of cloud redis? How to use cloud redis?
notepad++如何统计单词数量
About how idea sets up shortcut key sets
window上用.bat文件启动项目
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)
flask-sqlalchemy 循环引用
Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture
Electronic Association C language level 1 34, piecewise function
Used on windows Bat file startup project
[Flink] temporal semantics and watermark
SQL foundation 9 [grouping data]
Transition technology from IPv4 to IPv6
How to input single quotation marks and double quotation marks in latex?
"Sword finger offer" 2nd Edition - force button brush question
Four sets of APIs for queues
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
【FPGA教程案例7】基于verilog的计数器设计与实现
the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘