put 메소드는 메시지 큐 끝에 메시지를 추가합니다.
시그니처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);
}