当前位置:网站首页>Name conventions in FreeRTOS
Name conventions in FreeRTOS
2022-08-02 12:32:00 【Mountain,】
Data Type
TickType_t
: FreeRTOS interrupt count value type, which can be 16-bit or 32-bit. For 32-bit CPU, TickType_t
is preferably 32-bit.
BaseType_t
: It is the data type that can make the CPU run more efficiently.
For 32-bit CPU, BaseType_t
is uint32_t
.16-bit CPU is uint16_t
, 8-bit CPU is uint8_t
.
Usually BaseType_t
is used as a simple return value and logical value type, such as:
pdTRU1 | 1 |
---|---|
pdFALSE | 0 |
pdPASS | 1 |
pdFAIL | 0 |
When writing a program, you can set the return value type to BaseType_t
type.
variable name
The variable name consists of the prefix + the variable name.
The prefix is used to indicate some attributes of the variable, such as what type of variable is, char, short, long, or pointer type, etc.
prefix | Meaning |
---|---|
c | char |
s | short |
l | long |
u | unsigned |
uc | unsigned char |
us | unsigned short |
ul | unsigned long |
x | BaseType_t type or complex type such as structure |
p | Pointer |
pc | char pointer |
function name
The function name is also composed of the prefix + function name, where the prefix is composed of the return value type and the file name where the function is located.
For example:
vTaskXXXX();
indicates that the return value of the function is void type, this function is defined in the Task.c
file
xQueueXXXX();
indicates that the return value of the function is a structure or a more complex type such as BaseType_t
, this function is in Queue.c
is defined in the file
pvXXXX();
indicates that the return value type of the function is void*
type, which is defined in the timers.c
file
prvXXX:
prv means private, it is a private function that is a function of type static
Macro Name
The prefix of the macro name indicates which file it is defined in
For example:
taskENTER_DRITICAL()
is defined in task.h
pdRTUE
is defined in projdefs.h
configUSE_PREEMPTION
is defined in FreeRTOSConfig.h
Understanding the naming conventions of variables, functions, macros, etc. in FreeRTOS, we can know the return value type of the function or variable according to the name or is defined in that file, and can quickly find them, which is convenient for us to find and understandFreeRTOS.
边栏推荐
猜你喜欢
MyCat2的介绍与安装以及基本使用
以Boost为例的type3电压环补偿器实例
Lexicon 27 - Remove Elements - Simple Questions
手撸架构,Mysql 面试126问
js真3d柱状图插件
Taurus.MVC V3.0.3 Microservice Open Source Framework Released: Make the evolution of .NET architecture easier in large concurrency.
PHP伪协议详解
【第六届强网杯CTF-Wp】
darknet训练yolov4模型
Process finished with exit code 1
随机推荐
用位运算为你的程序加速
TFRecord简介,原理分析,代码实现?[通俗易懂]
Golang map数组按字段分类
【The 6th Strong Net Cup CTF-Wp】
Thymeleaf
【第六届强网杯CTF-Wp】
Pytorch 占用cpu资源过多
SQL Server 2014安装教程(保姆级图解教程)
图神经网络(GNN)的简介「建议收藏」
Speed up your programs with bitwise operations
太厉害了,终于有人能把TCP/IP 协议讲的明明白白了
服务器间传输文件
手撸架构,MongDB 面试50问
SQL Server修改数据
手撸架构,网络 面试36问
An example of type3 voltage loop compensator taking Boost as an example
手撸架构,Redis面试41问
sql concat()函数
如何搭建威纶通触摸屏与S7-200smart之间无线PPI通信?
Data Lake (3): Hudi Concept Terminology