os_mbx_declare(MsgBox, 16); /* Declare an RTX mailbox */
U32 mpool[16*(2*sizeof(U32))/4 + 3]; /* Reserve a memory for 16 mes
//声明发送缓冲区的空间
#ifdef __USART_1
u32 USART_1_TPOOL[USART_SENDOBJ_NUM*((MAX_PACK_SIZE+3)/4) + 3];
#endif
#ifdef __USART_2
u32 USART_2_TPOOL[USART_SENDOBJ_NUM*((MAX_PACK_SIZE+3)/4) + 3];
#endif
#ifdef __USART_3
u32 USART_3_TPOOL[USART_SENDOBJ_NUM*((MAX_PACK_SIZE+3)/4) + 3];
#endif
//声明缓冲区
USART_msgpool_ptr_declare(USART_mTpool, USART_NUM); //发送缓冲区
USART_msgpool_declare(USART_mRpool, USART_NUM*(USART_RECVOBJ_NUM)); //接收缓冲区
//声明发送邮箱
USART_mbx_arr_declare(USART_MBX_TX,USART_NUM,USART_SENDOBJ_NUM);
//声明接收邮箱
USART_mbx_arr_declare(USART_MBX_RX,USART_NUM,USART_RECVOBJ_NUM);
为什么定义一个rtx实时系统邮箱的缓存长度都要用一个(x+3)/4 +3 |