硬汉嵌入式论坛

 找回密码
 立即注册
查看: 1403|回复: 3
收起左侧

[其它] CMSIS软件包中弄的这种注释形式挺有意义

[复制链接]

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107071
QQ
发表于 2023-1-28 08:26:36 | 显示全部楼层 |阅读模式

CMSIS_5/cmsis_os2_MemPool.txt at develop · ARM-software/CMSIS_5 (github.com)
这种横条注释

[C] 纯文本查看 复制代码
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/


[C] 纯文本查看 复制代码
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
//  ==== Memory Pool Management ====
/** 
\addtogroup CMSIS_RTOS_PoolMgmt Memory Pool
\ingroup CMSIS_RTOS
\brief Manage thread-safe fixed-size blocks of dynamic memory.
\details
\b Memory \b Pools are fixed-size blocks of memory that are thread-safe. They operate much faster than the dynamically
allocated heap and do not suffer from fragmentation. Being thread-safe, they can be accessed from threads and ISRs alike.

A Memory Pool can be seen as a linked list of available (unused) memory blocks of fixed and equal size. Allocating memory
from a pool (using \ref osMemoryPoolAlloc) simply unchains a block from the list and hands over control to the user. Freeing
memory to the pool (using \ref osMemoryPoolFree) simply rechains the block into the list.

\image html "mempool.png" "CMSIS-RTOS Memory Pools"

\note One must not write to freed block. It is up to the implementation to reuse the memory of unused blocks for internal
control data, i.e. linked list pointers.

\b Shared \b memory is one of the basic models to exchange information between threads. Using memory pools for exchanging
data, you can share more complex objects between threads if compared to a \ref CMSIS_RTOS_Message. Memory pool management
functions are used to define and manage such fixed-sized memory pools.

\note The functions \ref osMemoryPoolAlloc, \ref osMemoryPoolFree, \ref osMemoryPoolGetCapacity,
\ref osMemoryPoolGetBlockSize, \ref osMemoryPoolGetCount, \ref osMemoryPoolGetSpace can be called from
\ref CMSIS_RTOS_ISR_Calls "Interrupt Service Routines".
\note Refer to \ref memPoolConfig for RTX5 configuration options.

@{
*/

/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/** 
\typedef osMemoryPoolId_t
\details 
Returned by:
- \ref osMemoryPoolNew
*/

/** 
\struct osMemoryPoolAttr_t
\details
Attributes to configure a memory pool.

Refer to \ref CMSIS_RTOS_MemoryMgmt for details about usage of
 - osMemoryPoolAttr_t::cb_mem
 - osMemoryPoolAttr_t::cb_size
 - osMemoryPoolAttr_t::mp_mem
 - osMemoryPoolAttr_t::mp_size
*/



一方面可以分界函数段落,又可以方便查看函数或者注释过长,当然很多编辑器已经支持了这种边界设置。

回复

使用道具 举报

210

主题

1045

回帖

1685

积分

至尊会员

More we do, more we can do.

积分
1685
发表于 2023-1-28 09:56:37 | 显示全部楼层
本帖最后由 emwin 于 2023-1-28 10:03 编辑

这个应该是DoxyGen生成的文件,附上你文本对应页面: image.png
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107071
QQ
 楼主| 发表于 2023-1-28 10:11:37 | 显示全部楼层
emwin 发表于 2023-1-28 09:56
这个应该是DoxyGen生成的文件,附上你文本对应页面:

回复

使用道具 举报

8

主题

157

回帖

181

积分

初级会员

积分
181
发表于 2023-1-31 11:13:58 | 显示全部楼层
emwin 发表于 2023-1-28 09:56
这个应该是DoxyGen生成的文件,附上你文本对应页面:

厉害。但我翻看配置,不知道哪个参数才能组合成这样的效果。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-16 10:27 , Processed in 0.195287 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表