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.

ParameterCallbackTimeoutpDataAdditional Information<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> keeps track of the timers by using a linked list. Once the timeout is expired, the callback routinewill be called immediately (unless the task is in a critical region or has interrupts disabled).This macro uses the functions OS_CreateTimer_Ex() and OS_StartTimer_Ex().OS_TIMERROUTINE_EX is defined in <strong>RTOS</strong>.h as follows:typedef void OS_TIMER_EX_ROUTINE(void *);Source of the macro (in <strong>RTOS</strong>.h):#define OS_CREATETIMER_EX(pTimerEx,cb,Timeout,pData) \OS_CreateTimerEx(pTimerEx,cb,Timeout,pData); \OS_StartTimerEx(pTimerEx);ExampleOS_TIMER TIMER100;OS_TASK TCB_HPvoid Timer100(void) {LED = LED ? 0 : 1; /* Toggle LED */if (pTask != NULL) {OS_SignalEvent(0x01, (OS_TASK*)pTask)}OS_RetriggerTimerEx(&TIMER100); /* Make timer periodical */}void InitTask(void) {/* Create and start Timer100 */OS_CREATETIMER_Ex(&TIMER100, Timer100, 100, (void*) &TCB_HP);}OS_CreateTimerEx()DescriptionCreates an extended software timer without starting it.PrototypeDescriptionTable 30: OS_CREATETIMER_EX() parameter listPointer to the callback routine to be called from the <strong>RTOS</strong> after expiration of the delay. Thecallback function has to be of type OS_TIMER_EX_ROUTINE which takes a void pointer asparameter and does not return any value.Initial timeout in basic <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> time units (nominal ms):The data type OS_TIME is defined as an integer, therefore valid values are:1

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

Saved successfully!

Ooh no, something went wrong!