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.

OS_EVENT_Wait()DescriptionWaits for an event and suspends the calling task as long as the event is not signaled.Prototypevoid OS_EVENT_Wait (OS_EVENT* pEvent)ParameterDescriptionpEventTable 91: OS_EVENT_Wait() parameter listAdditional InformationIf the specified event object is already set, the calling task resets the event and continues operation. If the specifiedevent object is not set, the calling task is suspended until the event object becomes signaled. pEvent has to addressan existing event object, which has to be created before the call of OS_EVENT_Wait(). The debug version of <strong>IAR</strong><strong>PowerPac</strong> <strong>RTOS</strong> will check whether pEvent addresses a valid event object and will call OS_Error() with errorcode OS_ERR_EVENT_INVALID in case of an error.ImportantThis function may not be called from within an interrupt handler or software timer.ExampleOS_EVENT_Wait(&_HW_Event); /* Wait for event object */OS_EVENT_WaitTimed()DescriptionWaits for an event and suspends the calling task for a specified time as long as the event is not signaled.Prototypechar OS_EVENT_WaitTimed (OS_EVENT* pEvent, OS_TIME Timeout)ParameterDescriptionpEventTimeoutTable 92: OS_EVENT_Wait() parameter listReturn value0 success, the event was signaled within the specified time.1 if the event was not signaled and a timeout occured.Additional InformationIf the specified event object is already set, the calling task resets the event and continues operation. If the specifiedevent object is not set, the calling task is suspended until the event object becomes signaled or the timeout time hasexpired.pEvent has to address an existing event object, which has to be created before the call of OS_EVENT_WaitTimed().The debug version of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> will check whether pEvent addresses a valid event object and will callOS_Error() with error code OS_ERR_EVENT_INVALID in case of an error.ImportantPointer to the event object that the task will be waiting for.Pointer to the event object that the task will be waiting for.Maximum time in timer ticks until the event have to be signaled.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!