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.

MailboxesOS_WaitMail()DescriptionWaits until a mail is available, but does not retrieve the message from the mailbox.Prototypevoid OS_WaitMail (OS_MAILBOX* pMB);ParameterDescriptionpMBPointer to the mailbox.Table 68: OS_WaitMail() parameter listAdditional InformationIf the mailbox is empty, the task is suspended until a mail is available, otherwise the task continues.The task continues execution, according to the rules of the scheduler, as soon as a mail is available, but the mail is notretrieved from the mailbox.ImportantThis function may not be called from within an interrupt handler.OS_ClearMB()DescriptionClears all messages in a specified mailbox.Prototypevoid OS_ClearMB (OS_MAILBOX* pMB);ParameterDescriptionpMBTable 69: OS_ClearMB() parameter listExampleOS_MAILBOX MBKey;char MBKeyBuffer[6];/** Clear keyboard type ahead buffer*/void ClearKeyBuffer(void) {OS_ClearMB(&MBKey);}OS_GetMessageCnt()DescriptionReturns the number of messages currently available in a specified mailbox.Prototypeunsigned int OS_GetMessageCnt (OS_MAILBOX* pMB);ParameterDescriptionpMBReturn valueThe number of messages in the mailbox.ExamplePointer to the mailbox.Pointer to the mailbox.Table 70: OS_GetMessageCnt() parameter listchar GetKey(void) {if (OS_GetMessageCnt(&MBKey)) return WaitKey();return 0;}PP<strong>RTOS</strong>-269

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

Saved successfully!

Ooh no, something went wrong!