硬汉嵌入式论坛

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

[RL-RTX] RTX5的动态内存管理模块使用问题

[复制链接]

3

主题

1223

回帖

1232

积分

至尊会员

积分
1232
发表于 2019-11-28 09:33:27 | 显示全部楼层 |阅读模式
使用MDK建立的RTX5工程,#include "rtx_lib.h"  这个头文件是不是只有RTX5的OS组件才用的到,用户代码不需要使用这个头文件呢?
我在测试407工程中外部SRAM的动态内存分配时,用到:osRtxMemoryInit 函数,但是需要包含 "rtx_lib.h" 头文件,MDK工程报错说
找不到这个头文件,但是工程里面RTX5的组件都有包含这个头文件,他们却不报错,奇怪了!
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106749
QQ
发表于 2019-11-28 15:49:06 | 显示全部楼层
供用户调用的是这些:

QQ截图20191128154832.jpg
回复

使用道具 举报

3

主题

1223

回帖

1232

积分

至尊会员

积分
1232
 楼主| 发表于 2019-11-28 16:43:28 | 显示全部楼层
原来这些都在 cmsis_os2.h header file 里面。

/// Allocate a memory block from a Memory Pool.
/// \param[in]     mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
/// \param[in]     timeout       \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
/// \return address of the allocated memory block or NULL in case of no memory is available.
void *osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout);

/// Return an allocated memory block back to a Memory Pool.
/// \param[in]     mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
/// \param[in]     block         address of the allocated memory block to be returned to the memory pool.
/// \return status code that indicates the execution status of the function.
osStatus_t osMemoryPoolFree (osMemoryPoolId_t mp_id, void *block);

/// Get maximum number of memory blocks in a Memory Pool.
/// \param[in]     mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
/// \return maximum number of memory blocks.
uint32_t osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id);

/// Get memory block size in a Memory Pool.
/// \param[in]     mp_id         memory pool ID obtained by \ref osMemoryPoolNew.
/// \return memory block size in bytes.
uint32_t osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id);

================================================
* ----------------------------------------------------------------------
*
* $Date:        18. June 2018
* $Revision:    V2.1.3
*
* Project:      CMSIS-RTOS2 API
* Title:        cmsis_os2.h header file
*
* Version 2.1.3
*    Additional functions allowed to be called from Interrupt Service Routines:
*    - osThreadGetId
* Version 2.1.2
*    Additional functions allowed to be called from Interrupt Service Routines:
*    - osKernelGetInfo, osKernelGetState
* Version 2.1.1
*    Additional functions allowed to be called from Interrupt Service Routines:
*    - osKernelGetTickCount, osKernelGetTickFreq
*    Changed Kernel Tick type to uint32_t:
*    - updated: osKernelGetTickCount, osDelayUntil
* Version 2.1.0
*    Support for critical and uncritical sections (nesting safe):
*    - updated: osKernelLock, osKernelUnlock
*    - added: osKernelRestoreLock
*    Updated Thread and Event Flags:
*    - changed flags parameter and return type from int32_t to uint32_t
* Version 2.0.0
*    Initial Release
*---------------------------------------------------------------------------*/

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 09:11 , Processed in 0.219521 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

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