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.

An unlimited number of tasks can wait for a resource semaphore. According to the rules of the scheduler, of all thetasks waiting for the resource, the task with the highest priority will get access to the resource and can continueprogram execution.ImportantThis function may not be called from within an interrupt handler.The following diagram illustrates how the OS_Use() routine works:OS_Use(...)Resourcein use?Yes, byother taskWait for resourceto be releasedYes, by this taskNoMark current taskas ownerIncrease UsagecounterUsage counter = 1returnreturnOS_Unuse()DescriptionReleases a semaphore currently in use by a task.Prototypevoid OS_Unuse (OS_RSEMA* pRSema)ParameterDescriptionpRSemaTable 43: OS_Unuse() parameter listAdditional InformationOS_Unuse() may be used on a resource semaphore only after that semaphore has been used by calling OS_Use() orOS_Request(). OS_Unuse() decrements the usage counter of the semaphore which must never become negative. Ifthis counter becomes negative, the debug version will call the <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> error handler.ImportantPointer to the data structure for a resource semaphore.This function may not be called from within an interrupt handler.52<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

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

Saved successfully!

Ooh no, something went wrong!