OSMemPut()
void OSMemPut (OS_MEM *p_mem,
void *p_blk,
OS_ERR *p_err)
File |
Called from |
Code enabled by |
os_mem.c |
Task or ISR |
OS_CFG_MEM_EN |
OSMemPut() returns a memory block back to a memory partition. It is assumed that the user will return the memory block to the same memory partition from which it was allocated.
Arguments
p_mem
is a pointer to the memory partition control block.
p_blk
is a pointer to the memory block to be returned to the memory partition.
p_err
is a pointer to a variable that holds an error code:
Returned Value
None
Notes/Warnings
Memory partitions must be created before they are used.
You must return a memory block to the proper memory partition.
You can call this function from an ISR or a task.
Example
OS_MEM CommMem; CPU_INT32U *CommMsg;
void Task (void *p_arg) { OS_ERR err;
(void)&p_arg; while (DEF_ON) { OSMemPut(&CommMem, (void *)CommMsg, &err); /* Check “err” */ : : } } |