当前位置:网站首页>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);
边栏推荐
- the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
- NLP literature reading summary
- 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)
- Paddleocr prompt error: can not import AVX core while this file exists: xxx\paddle\fluid\core_ avx
- Check and display one column in the known table column
- MySQL error resolution - error 1261 (01000): row 1 doesn't contain data for all columns
- Vulhub vulnerability recurrence 77_ zabbix
- Experience installing VMware esxi 6.7 under VMware Workstation 16
- Chapter 1 programming problems
猜你喜欢
CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions
uniapp小程序分包
Four sets of APIs for queues
The final week, I split
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
[web security] nodejs prototype chain pollution analysis
电脑通过Putty远程连接树莓派
The important role of host reinforcement concept in medical industry
Guoguo took you to write a linked list, and the primary school students said it was good after reading it
[Mori city] random talk on GIS data (I)
随机推荐
js 常用时间处理函数
Solution of running crash caused by node error
Latex中的单引号,双引号如何输入?
Four sets of APIs for queues
Detailed introduction to the big changes of Xcode 14
Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture
Docker install MySQL
Used on windows Bat file startup project
A new understanding of how to encrypt industrial computers: host reinforcement application
电脑通过Putty远程连接树莓派
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
About how idea sets up shortcut key sets
Cochez une colonne d'affichage dans une colonne de tableau connue
Zephyr Learning note 2, Scheduling
电子协会 C语言 1级 34 、分段函数
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
How to input single quotation marks and double quotation marks in latex?
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
Transition technology from IPv4 to IPv6
【网络数据传输】基于FPGA的百兆网/兆网千UDP数据包收发系统开发,PC到FPGA