Professional Documents
Culture Documents
Routine
Attributes Description
os_mbx_check
os_mbx_declar
e
os_mbx_init
os_mbx_send
os_mbx_wait
isr_mbx_check
isr_mbx_receive
isr_mbx_send
Note
The mailbox management routines enable you to send and receive messages between tasks using
mailboxes.
The os_mbx_declare routine is implemented as a macro.
Using a Mailbox
Home RL-RTX Using RL-RTX Writing Programs Using a Mailbox
The RTX kernel message objects are simply pointers to a block of memory where the relevant information is stored.
There is no restriction regarding the message size or content. The RTX kernel handles only the pointer to this
message.
For 8-bit and 16-bit messages, it is better to use a parameter casting and convert a message value directly to a
pointer.
The following example shows you how to send fixed size messages to a mailbox (see the mailbox example for more
information). The message size is 8 bytes (two unsigned ints).
#include <rtl.h>
mptr[0] = 0x3215fedc;
mptr[1] = 0x00000015;
os_mbx_send (MsgBox, mptr, 0xffff);
os_tsk_delete_self ();
}
rec_val[0] = rptr[0];
rec_val[1] = rptr[1];
_free_box (mpool, rptr);
os_tsk_delete_self ();
}
The fixed block memory allocation functions are fully reentrant. The variable length memory allocation
functions are not reentrant. Therefore the system timer interrupts need to be disabled during the execution of the
malloc() or free() function. Function tsk_lock() disables timer interrupts and function tsk_unlock() enables timer
interrupts.