当前位置:网站首页>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.cis 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.
边栏推荐
- Basic protocol explanation
- 7种最常用数据分析思维,解决95%的分析难题
- WebUI自动化测试框架搭建从0到1(完整源码)更新完毕
- Golang map数组按字段分类
- SQL Server 2014安装教程(保姆级图解教程)
- unique in numpy & pandas
- Solve the problem of Chinese garbled characters in exporting excel file names
- np.nan, np.isnan, None, pd.isnull, pd.isna 整理与小结
- DTG-SSOD:最新半监督检测框架,Dense Teacher(附论文下载)
- Free Chinese-English Translation Software - Automatic Batch Chinese-English Translation Software Recommended Daquan
猜你喜欢

Drools(8):WorkBench使用

FreeRTOS实验--删除任务

WPF——自定义日历

The 7 most commonly used data analysis thinking, solve 95% of the analysis problems

After Effects 教程,如何在 After Effects 中对蒙版进行动画绘制?

FreeRTOS experiment--one function creates multiple tasks

Swiper系列之轮播图

【第六届强网杯CTF-Wp】

FreeRTOS创建任务--动态创建、静态创建

以Boost为例的type3电压环补偿器实例
随机推荐
看我如何用多线程,帮助运营小姐姐解决数据校对系统变慢!
zabbix自动化监控脚本
openresty 性能优化
技术分享| 融合调度系统中的电子围栏功能说明
Free Chinese-English Translation Software - Automatic Batch Chinese-English Translation Software Recommended Daquan
Intelligent Image Analysis-Intelligent Home Appliance Image Target Detection Statistical Counting Detection and Recognition-iCREDIT
FreeRTOS experiment--one function creates multiple tasks
JVM学习----垃圾回收调优
Manual architecture, Mysql interview 126 questions
FreeRTOS--优先级实验
Create your own app applet ecosystem with applet containers
30行代码实现无服务器实时健康码识别--操作手册
观察者(observer)模式(二) —— 实现线程安全的监听器
FreeRTOS实验--一个函数创建多个任务
svg实现的树木四季变化
Technology sharing | Description of the electronic fence function in the integrated dispatching system
以Boost为例的type3电压环补偿器实例
WPF——自定义日历
Transfer files between servers
【The 6th Strong Net Cup CTF-Wp】