FreeRTOS中的命名前缀
在 FreeRTOS 中,变量名的前缀(perfixes)遵循严格的匈牙利命名法(Hungarian-style naming convention).
px Prefix Breakdown
| Prefix | Meaning | Example | Typical Type |
|---|---|---|---|
p | pointer | pucBuffer | pointer to something (void *, uint8_t *, etc.) |
px | pointer to a structure (type name starts with x) | pxNext, pxItem, pxList | pointer to a struct like xList, xListItem, etc. |
x | structure (not a pointer) | xList, xEventGroup | structure itself (not a pointer) |
v | function returns void | vTaskDelay() | indicates no return value |
ux | unsigned integer | uxNumberOfTasks | type: UBaseType_t (unsigned) |
c | char | cStatus | char |
uc | unsigned char / uint8_t | ucPriority | uint8_t |
b | boolean | bFlag | typically BaseType_t or bool |
pv | pointer to void | pvParameters, pvOwner | void * |
参考官网:Naming Conventions
评论已关闭