The isr_mbx_receive function gets a pointer to a message from the mailbox if the mailbox is not empty. The function puts the message pointer from the mailbox into the location pointed by the message argument. The isr_mbx_receive function does not cause the current task to sleep even if there is no message in the mailbox. Hence this function can be called from an interrupt function. You can use the isr_mbx_receive function to receive a message or a protocol frame (for example TCP-IP, UDP, and ISDN) in an interrupt function. The isr_mbx_receive function is in the RL-RTX library. The prototype is defined in rtl.h. Note - You must declare and initialize the mailbox object before you perform any operation on it.
- You can call the isr_mbx_receive function only from IRQ interrupt functions. You cannot call it from the FIQ interrupt function.
- When you get the message from the mailbox, you must free the memory block containing the message to avoid running out of memory.
- When you get the message from the mailbox, space is created in the mailbox for a new message.
|