特征符RiCOSResult RiCOSMessageQueue_put(
RiCOSMessageQueue *const me, gen_ptr message,
RiCBoolean fromISR);
参数me
这是要将消息添加至的
RiCOSMessageQueue
message
这是要添加至队列的消息
fromISR
这是一个布尔值,用于确定所添加的消息是否是中断服务例程 (ISR) 生成的
返回RiCOS*.h 文件中定义的 RiCOSResult 对象
示例RiCOSResult RiCOSMessageQueue_put(
RiCOSMessageQueue * const me, gen_ptr message,
RiCBoolean fromISR)
{
static gen_ptr NULL_VAL = NULL;
int timeout = WAIT_FOREVER;
int priority = MSG_PRI_NORMAL;
if (message == NULL) message = NULL_VAL;
if (fromISR) {
timeout = NO_WAIT;
priority = MSG_PRI_URGENT;
}
return (msgQSend(me->hVxMQ, (char*)&message,
sizeof(message), timeout, priority) == OK);
}