当前位置:网站首页>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);边栏推荐
- Four sets of APIs for queues
- Responsive mobile web test questions
- The final week, I split
- Master-slave replication principle of MySQL database
- [freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
- rapidjson读写json文件
- MySQL 45 learning notes (XI) how to index string fields
- 【FPGA教程案例8】基于verilog的分频器设计与实现
- Bottom problem of figure
- 输入年份、月份,确定天数
猜你喜欢

Campus network problems

NLP literature reading summary

CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions

The IP bound to the socket is inaddr_ The meaning of any htonl (inaddr_any) (0.0.0.0 all addresses, uncertain addresses, arbitrary addresses)

Zabbix agent主动模式的实现
![[GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph](/img/5e/7ce21dd544aacf23b4ceef1ec547fd.png)
[GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph

图的底部问题

NLP-文献阅读总结

BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment

Data double write consistency between redis and MySQL
随机推荐
MySQL 45 lecture learning notes (VII) line lock
Master-slave replication principle of MySQL database
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
由于dms升级为了新版,我之前的sql在老版本的dms中,这种情况下,如何找回我之前的sql呢?
高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
Chapter 1 programming problems
测试用例的设计
Directory of tornado
How to share the source code anti disclosure scheme
电子协会 C语言 1级 35 、银行利息
If there are two sources in the same job, it will be reported that one of the databases cannot be found. Is there a boss to answer
请问旧版的的常用SQL怎么迁移到新版本里来?
What is industrial computer encryption and how to do it
Bottom problem of figure
How notepad++ counts words
Literature collation and thesis reading methods
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Knowledge payment applet dream vending machine V2
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis