02.01.2015 Views

CooCox CoOS User's Guide

CooCox CoOS User's Guide

CooCox CoOS User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example usage:<br />

#include "CCRTOS.h"<br />

void TaskM (void *pdata)<br />

{<br />

U8 Hour, Minute, Second;<br />

U16 Millisecond;<br />

...<br />

CoTickToTime (1949,<br />

&Hour,<br />

&Minute,<br />

&Second,<br />

&Millisecond);<br />

printf ("1949 system ticks = %2d-%02d-%02d-%03d \n",<br />

Hour, Minute, Second, Millisecond);<br />

}<br />

...<br />

Note:<br />

None<br />

6.11.2 CoTimeToTick()<br />

Function Prototype:<br />

StatusType CoTimeToTick(<br />

U8 hour,<br />

U8 minute,<br />

U8 sec,<br />

U16 millsec,<br />

U32* ticks<br />

);<br />

Description:<br />

Convert the time to proper systick number.<br />

Parameters:<br />

[in] hour<br />

Hours<br />

[in] minute<br />

Minutes<br />

[in] sec<br />

Seconds<br />

[in] millsec<br />

Milliseconds<br />

[in] ticks<br />

Systick number<br />

120

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

Saved successfully!

Ooh no, something went wrong!