c1310 tirtos开发的时候动态内存分配函数malloc和free 使用会导致射频的postcmd函数返回-2 也就是分配内存失败 很奇怪, 最后是自己写了简单的内存分配代码实现的命令缓冲
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
c1310 tirtos开发的时候动态内存分配函数malloc和free 使用会导致射频的postcmd函数返回-2 也就是分配内存失败 很奇怪, 最后是自己写了简单的内存分配代码实现的命令缓冲
试试这个:
Public function defined in ssf.h
*/
void *Ssf_malloc(uint16_t size)
{
#ifdef OSAL_PORT2TIRTOS
return OsalPort_malloc(size);
#else
return ICall_malloc(size);
#endif
}
/*!
Ssf implementation for memory de-allocation
Public function defined in ssf.h
*/
void Ssf_free(void *ptr)
{
if(ptr != NULL)
{
#ifdef OSAL_PORT2TIRTOS
OsalPort_free(ptr);
#else
ICall_free(ptr);
#endif
}
}