CooCox CoOS User's Guide
CooCox CoOS User's Guide
CooCox CoOS User's Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Returns:<br />
E_OK,<br />
Get the current counter of the timer successfully.<br />
The current counter of the specified software timer<br />
Example Usage:<br />
#include "CCRTOS.h"<br />
OS_TCID sftmr;<br />
void TaskN (void *pdata)<br />
{<br />
}<br />
Note:<br />
None<br />
StatusType result;<br />
U32<br />
...<br />
sftcnt;<br />
sftcnt = CoGetCurTimerCnt (sftmr, &result);<br />
if (result != E_OK)<br />
{<br />
}<br />
{<br />
if (result == E_INVALID_ID)<br />
}<br />
else<br />
{<br />
}<br />
6.4.6 CoSetTmrCnt()<br />
printf("The timer id passed is invalid, failed to get. \n");<br />
printf("Current Timer Counter : %ld", sftcnt);<br />
...<br />
Function Prototype:<br />
StatusType CoSetTmrCnt<br />
Description:<br />
(<br />
);<br />
OS_TCID<br />
U32<br />
U32<br />
Set the timer counter and reload value.<br />
Parameters:<br />
[IN] tmrID<br />
The ID of the specified timer<br />
[IN] tmrCnt<br />
The count value to be reset to<br />
tmrID,<br />
tmrCnt,<br />
tmrReload<br />
67