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.

E_OK,<br />

Obtain the number successfully.<br />

Returns:<br />

fbNum, The number of the free block in the memory partition<br />

Example usage:<br />

#include "CCRTOS.h"<br />

OS_MMID mmc;<br />

void TaskN (void *pdata)<br />

{<br />

U32 blocknum;<br />

StatusType result;<br />

...<br />

/* Get free blocks’ number */<br />

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

blocknum = CoGetFreeBlockNum(mmc, &result);<br />

if (result != E_OK)<br />

{<br />

if (result == E_INVALID_ID) {<br />

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

}<br />

}<br />

...<br />

}<br />

Note:<br />

None<br />

76

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

Saved successfully!

Ooh no, something went wrong!