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...

Create successful ePaper yourself

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

Software timersOS_SetTimerPeriod()DescriptionSets a new timer reload value for a specified timer.Prototypevoid OS_SetTimerPeriod (OS_TIMER* pTimer,OS_TIME Period);ParameterDescriptionpTimerPeriodTable 25: OS_SetTimerPeriod() parameter listAdditional InformationOS_SetTimerPeriod() sets the initial time value of the specified timer. Period is the reload value of the timer to beused as initial value when the timer is retriggered by OS_RetriggerTimer().ExampleOS_TIMER TIMERPulse;BOOL CursorOn;void TimerPulse(void) {if TogglePulseOutput(); /* Toggle output */OS_RetriggerTimer(&TIMERCursor); /* Make timer periodical */}void InitTask(void) {/* Create and start Pulse Timer with first pulse = 500ms */OS_CREATETIMER(&TIMERPulse, TimerPulse, 500);/* Set timer period to 200 ms for further pulses */OS_SetTimerPeriod(&TIMERPulse, 200);}OS_DeleteTimer()DescriptionStops and deletes a specified timer.Prototypevoid OS_DeleteTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 26: OS_DeleteTimer() parameter listAdditional InformationThe timer is stopped and therefore removed out of the linked list of running timers. In debug builds of <strong>IAR</strong> <strong>PowerPac</strong><strong>RTOS</strong>, the timer is also marked as invalid.OS_GetTimerPeriod()DescriptionReturns the current reload value of a specified timer.PrototypePointer to the OS_TIMER data structure which contains the data of the timer.Timer period 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!