31 #if !defined(CH_CFG_USE_MAILBOXES) 32 #define CH_CFG_USE_MAILBOXES FALSE 35 #if (CH_CFG_USE_MAILBOXES == TRUE) || defined(__DOXYGEN__) 82 #define _MAILBOX_DATA(name, buffer, size) { \ 84 (msg_t *)(buffer) + size, \ 89 _THREADS_QUEUE_DATA(name.qw), \ 90 _THREADS_QUEUE_DATA(name.qr), \ 102 #define MAILBOX_DECL(name, buffer, size) \ 103 mailbox_t name = _MAILBOX_DATA(name, buffer, size) msg_t chMBFetchTimeoutS(mailbox_t *mbp, msg_t *msgp, sysinterval_t timeout)
Retrieves a message from a mailbox.
size_t cnt
Messages in queue.
msg_t chMBPostTimeoutS(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts a message into a mailbox.
uint64_t sysinterval_t
Type of time interval.
static size_t chMBGetFreeCountI(const mailbox_t *mbp)
Returns the number of free message slots into a mailbox.
Generic threads bidirectional linked list header and element.
msg_t chMBPostAheadI(mailbox_t *mbp, msg_t msg)
Posts an high priority message into a mailbox.
msg_t chMBFetchI(mailbox_t *mbp, msg_t *msgp)
Retrieves a message from a mailbox.
msg_t * top
Pointer to the location after the buffer.
void chDbgCheckClassI(void)
I-class functions context check.
static size_t chMBGetSizeI(const mailbox_t *mbp)
Returns the mailbox buffer size as number of messages.
void chMBResetI(mailbox_t *mbp)
Resets a mailbox_t object.
static size_t chMBGetUsedCountI(const mailbox_t *mbp)
Returns the number of used message slots into a mailbox.
msg_t * buffer
Pointer to the mailbox buffer.
void chMBReset(mailbox_t *mbp)
Resets a mailbox_t object.
msg_t chMBPostAheadTimeoutS(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts an high priority message into a mailbox.
threads_queue_t qr
Queued readers.
msg_t * wrptr
Write pointer.
threads_queue_t qw
Queued writers.
static void chMBResumeX(mailbox_t *mbp)
Terminates the reset state.
msg_t chMBFetchTimeout(mailbox_t *mbp, msg_t *msgp, sysinterval_t timeout)
Retrieves a message from a mailbox.
msg_t chMBPostI(mailbox_t *mbp, msg_t msg)
Posts a message into a mailbox.
msg_t chMBPostTimeout(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts a message into a mailbox.
bool reset
True in reset state.
msg_t chMBPostAheadTimeout(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts an high priority message into a mailbox.
static msg_t chMBPeekI(const mailbox_t *mbp)
Returns the next message in the queue without removing it.
Structure representing a mailbox object.
msg_t * rdptr
Read pointer.
void chMBObjectInit(mailbox_t *mbp, msg_t *buf, size_t n)
Initializes a mailbox_t object.