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.

Event objectsExampleOS_EVENT_Reset(&_HW_Event); /* Reset event object to non-signaled state */OS_EVENT_Pulse()DescriptionSignals an event object and resumes waiting tasks, then resets the event object to non-signaled state.Prototypevoid OS_EVENT_Pulse (OS_EVENT* pEvent);ParameterDescriptionpEventTable 95: OS_EVENT_Pulse() parameter listAdditional InformationIf any tasks are waiting at the event object, the tasks are resumed. The event object remains un-signaled. The debugversion of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> will check whether pEvent addresses a valid event object and will callOS_Error() with the error code OS_ERR_EVENT_INVALID in case of an error.OS_EVENT_Get()DescriptionReturns the state of an event object.Prototypeunsigned char OS_EVENT_Get (OS_EVENT* pEvent);ParameterDescriptionpEventTable 96: OS_EVENT_Get() parameter listReturn value0: Event object is not set to signaled state1: Event object is set to signaled state.Additional InformationBy calling this function, the actual state of the event object remains unchanged. pEvent has to address an existingevent object, which has been created before by a call of OS_EVENT_Create(). 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 error codeOS_ERR_EVENT_INVALID in case of an error.OS_EVENT_Delete()DescriptionDeletes an event object.Prototypevoid OS_EVENT_Delete (OS_EVENT* pEvent);ParameterDescriptionpEventTable 97: OS_EVENT_Delete() parameter listAdditional InformationTo keep the system fully dynamic, it is essential that event objects can be created dynamically. This also means therehas to be a way to delete an event object when it is no longer needed. The memory that has been used by the eventobject’s control structure can then be reused or reallocated.It is your responsibility to make sure that:●●Pointer to the event object which should be pulsed.Pointer to an event object who’s state should be examined.Pointer to an event object which should be deleted.the program no longer uses the event object to be deletedthe event object to be deleted actually exists (has been created first)PP<strong>RTOS</strong>-287

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

Saved successfully!

Ooh no, something went wrong!