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.

tasks so as to protect the critical resources.<br />

2) CoSchedUnlock() and CoSchedUnlock() must be used in pairs.<br />

6.1.6 CoSchedUnlock()<br />

Function Prototype:<br />

void CoSchedUnlock(void);<br />

Descriptions:<br />

Unlock the scheduler.<br />

Parameters:<br />

None<br />

Returns:<br />

None<br />

Example usage:<br />

#include "CCRTOS.c"<br />

void Task0 (void *pdata)<br />

{<br />

.....<br />

CoSchedLock();<br />

…..<br />

/* Process critical resources here */<br />

…..<br />

CoSchedUnlock();<br />

.....<br />

}<br />

Note:<br />

1) Decrease OSSchedLock by one. When it reaches 0, start task<br />

scheduling.<br />

2) CoSchedUnlock() and CoSchedUnlock() must be used in pairs.<br />

6.1.7 CoGetOSVersion()<br />

Function Prototype:<br />

OS_VER CoGetOSVersion(void);<br />

Descriptions:<br />

Obtain <strong>CooCox</strong> <strong>CoOS</strong>’s version.<br />

Parameters:<br />

None<br />

Returns:<br />

<strong>CoOS</strong>’s version<br />

45

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

Saved successfully!

Ooh no, something went wrong!