当前位置:网站首页>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);边栏推荐
- Selenium ide plug-in download, installation and use tutorial
- Directory of tornado
- [GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph
- SQL foundation 9 [grouping data]
- com. alibaba. nacos. api. exception. NacosException
- Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture
- Introduction to spark core components
- win10微软拼音输入法输入文字时候下方不出现中文提示
- 用于压缩视频感知增强的多目标网络自适应时空融合
- socket inet_ pton() inet_ Ntop() function (a new network address translation function, which converts the expression format and numerical format to each other. The old ones are inet_aton(), INET_ ntoa
猜你喜欢

the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘

Introduction to spark core components

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

Implementation of ZABBIX agent active mode

用于压缩视频感知增强的多目标网络自适应时空融合

Crawler (III) crawling house prices in Tianjin

Set JTAG fuc invalid to normal IO port
![[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

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

NLP literature reading summary
随机推荐
kubernetes集群之Label管理
notepad++如何统计单词数量
Unity 从Inspector界面打开资源管理器选择并记录文件路径
How to buy financial products in 2022?
Used on windows Bat file startup project
What is industrial computer encryption and how to do it
Mobile adaptation: vw/vh
在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
Knowledge payment applet dream vending machine V2
Pangu open source: multi support and promotion, the wave of chip industry
[untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
SQL foundation 9 [grouping data]
Solution of running crash caused by node error
Status of the thread
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
Campus network problems
Splicing plain text into JSON strings - easy language method
移动适配:vw/vh