From fb4ad35a747e6d7677013e294d30068441e23ee7 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 1 Feb 2024 13:54:26 +0800 Subject: [PATCH] =?UTF-8?q?1.Queue=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/source/commMng/sf_message_queue.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/application/source/sf_app/code/source/commMng/sf_message_queue.c b/code/application/source/sf_app/code/source/commMng/sf_message_queue.c index d11b23178..c919d2d44 100644 --- a/code/application/source/sf_app/code/source/commMng/sf_message_queue.c +++ b/code/application/source/sf_app/code/source/commMng/sf_message_queue.c @@ -99,12 +99,22 @@ SINT32 sf_com_message_app_init(void) } SINT32 sf_com_message_recv_from_app(SF_MESSAGE_BUF_S *pMessageBuf) { + if(sf_msgQueueId == -1) + { + perror("no init sf_msgQueueId"); + return 0; + } return message_queue_recv(sf_msgQueueId,pMessageBuf); } SINT32 sf_com_message_send_to_app(SF_MESSAGE_BUF_S *pMessageBuf) { pMessageBuf->mtype = 1; + if(sf_msgQueueId == -1) + { + perror("send no init sf_msgQueueId"); + return -1; + } return message_queue_send(sf_msgQueueId,pMessageBuf); } @@ -114,6 +124,11 @@ SINT32 sf_com_message_cardv_init(void) } SINT32 sf_com_message_recv_from_cardv(SF_MESSAGE_BUF_S *pMessageBuf) { + if(cardv_msgQueueId == -1) + { + perror("no init cardv_msgQueueId"); + return -1; + } return message_queue_recv(cardv_msgQueueId,pMessageBuf); } @@ -122,6 +137,11 @@ SINT32 sf_com_message_send_to_cardv(SF_MESSAGE_BUF_S *pMessageBuf) pMessageBuf->mtype = 1; //printf("[%s:%d] cmdId = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->cmdId); //sf_system_cardv_wait_done(); + if(cardv_msgQueueId == -1) + { + perror("send no init cardv_msgQueueId"); + return -1; + } return message_queue_send(cardv_msgQueueId,pMessageBuf); }