Mailboxes are used to communicate between tasks. More...
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.
Public Member Functions | |
| OS_MBOX () | |
| Create and initialize a mailbox object. | |
| OS_MBOX (void *msg) | |
| Create and initialize a mailbox object with a given message. More... | |
| uint8_t | Init (void *msg=NULL) |
| Sets the mailbox object to its initial state. More... | |
| uint8_t | Post (void *msg) |
| This function posts a message to the mailbox. More... | |
| void * | Pend (uint32_t timeoutTicks, uint8_t &result) |
| Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the timeout value. More... | |
| void * | PendNoWait (uint8_t &result) |
| Checks to see if a message has been posted to a mailbox, but does not wait. More... | |
| void * | Pend (uint32_t timeoutTicks=WAIT_FOREVER) |
| Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value. More... | |
| void * | PendNoWait () |
| Checks to see if a message has been posted to a mailbox, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide a return code. More... | |
Mailboxes are used to communicate between tasks.
|
inline |
Create and initialize a mailbox object with a given message.
| msg | Message that the mailbox should be initialized with |
| uint8_t OS_MBOX::Init | ( | void * | msg = NULL | ) |
Sets the mailbox object to its initial state.
| msg | Message that the mailbox should be initialized with |
| OS_NO_ERR | If successful |
| void * OS_MBOX::Pend | ( | uint32_t | timeoutTicks, |
| uint8_t & | result | ||
| ) |
Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the timeout value.
| timeoutTicks | The number of system ticks to wait | |
| [out] | result | The result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if it timed out. |
| Message | If successful |
| NULL | If it timed out |
|
inline |
Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value.
| timeoutTicks | The number of system ticks to wait |
| Message | If successful |
| NULL | If it timed out |
| void * OS_MBOX::PendNoWait | ( | uint8_t & | result | ) |
Checks to see if a message has been posted to a mailbox, but does not wait.
| [out] | result | The result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if there was no message. |
| Message | If successful |
| NULL | If it failed |
|
inline |
Checks to see if a message has been posted to a mailbox, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide a return code.
| Message | If successful |
| NULL | If it failed |
| uint8_t OS_MBOX::Post | ( | void * | msg | ) |
This function posts a message to the mailbox.
| msg | Message that the mailbox should post |
| OS_NO_ERR | If successful |
| OS_MBOX_FULL | If the mailbox is full |