11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

Software timers#define OS_CREATETIMER(pTimer,c,d) \OS_CreateTimer(pTimer,c,d); \OS_StartTimer(pTimer);ExampleOS_TIMER TIMER100;void Timer100(void) {LED = LED ? 0 : 1; /* Toggle LED */OS_RetriggerTimer(&TIMER100); /* Make timer periodical */}void InitTask(void) {/* Create and start Timer100 */OS_CREATETIMER(&TIMER100, Timer100, 100);}OS_CreateTimer()DescriptionCreates a software timer (but does not start it).Prototypevoid OS_CreateTimer (OS_TIMER* pTimer,OS_TIMERROUTINE* Callback,OS_TIME Timeout);ParameterDescriptionpTimerPointer to the OS_TIMER data structure which contains the data of the timer.CallbackPointer to the callback routine to be called from the <strong>RTOS</strong> after expiration of the delay.TimeoutInitial timeout in basic <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> time units (nominal ms):The data type OS_TIME defaults to an integer, therefore valid values are1

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

Saved successfully!

Ooh no, something went wrong!