02.01.2015 Views

CooCox CoOS User's Guide

CooCox CoOS User's Guide

CooCox CoOS User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.5.4 CoDelMemoryPartition()<br />

Function Prototype:<br />

StatusType CoDelMemoryPartition<br />

(<br />

OS_MMID mmID<br />

);<br />

Description:<br />

Delete a certain memory partition.<br />

Parameters:<br />

[IN] mmID<br />

The ID of the memory partition<br />

Returns:<br />

E_INVALID_ID, The ID of the memory partition is invalid.<br />

E_OK,<br />

Delete successfully.<br />

Example usage:<br />

#include "CCRTOS.h"<br />

OS_MMID mmc;<br />

void TaskN (void *pdata)<br />

{<br />

StatusType result;<br />

...<br />

/* Delete a memory partition */<br />

/* mmc: Created by other task */<br />

result = CoDelMemoryPartition(mmc);<br />

if (result != E_OK)<br />

{<br />

if (result == E_INVALID_ID)<br />

{<br />

printf("Invalid memory partition !\n");<br />

}<br />

}<br />

...<br />

}<br />

Note:<br />

1) Once deleting a memory partition, the resources of the memory<br />

control block which is occupied by this partition will be released.<br />

2) When deleting a memory partition, the system will not check whether<br />

it is idle, you can control it in your own applications.<br />

72

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!