当前位置:网站首页>Zephyr 学习笔记1,threads
Zephyr 学习笔记1,threads
2022-07-04 07:16:00 【mayiQX】
今天开始Zephyr学习,目标板子nrf9160。
第一章:如何创建线程(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 优先级分为协作式和抢占式
协作式
0,抢占式
0.

3.创建以及使用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);边栏推荐
- Electronic Association C language level 1 34, piecewise function
- Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
- [Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)
- ABCD four sequential execution methods, extended application
- Selection (023) - what are the three stages of event propagation?
- Summary of June 2022
- the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
- Deep understanding of redis -- a new type of bitmap / hyperloglgo / Geo
- Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
- Responsive - media query
猜你喜欢

About how idea sets up shortcut key sets

Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
![[Flink] temporal semantics and watermark](/img/4d/cf9c7e80ea416155cee62cdec8a5bb.jpg)
[Flink] temporal semantics and watermark

Deep profile data leakage prevention scheme

A new understanding of how to encrypt industrial computers: host reinforcement application

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

Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes

果果带你写链表,小学生看了都说好

Chain ide -- the infrastructure of the metauniverse

图的底部问题
随机推荐
[Valentine's day] - you can change your love and write down your lover's name
win10微软拼音输入法输入文字时候下方不出现中文提示
The important role of host reinforcement concept in medical industry
The crackdown on Huawei prompted made in China to join forces to fight back, and another enterprise announced to invest 100 billion in R & D
Campus network problems
How can the old version of commonly used SQL be migrated to the new version?
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
2022-021ARTS:下半年開始
A new understanding of how to encrypt industrial computers: host reinforcement application
MySQL 45 lecture learning notes (x) force index
Electronic Association C language level 1 35, bank interest
【FPGA教程案例8】基于verilog的分频器设计与实现
How to share the source code anti disclosure scheme
[Flink] temporal semantics and watermark
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture
[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)
[Mori city] random talk on GIS data (I)
what the fuck! If you can't grab it, write it yourself. Use code to realize a Bing Dwen Dwen. It's so beautiful ~!
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and