📄 ssp_msg.h
字号:
#ifdef __cplusplusextern "C"{#endif #ifndef __INC_SSP_MSG_H__#define __INC_SSP_MSG_H__#define MSG_TASK_MODE AOS_TASK_NOPREEMPT#define MSG_NUM_PER_QUE 100#ifndef L3_MSG_HEAD_LEN#define L3_MSG_HEAD_LEN (5*sizeof(U32))#endif#define MAX_L1_RESV_LEN 14#define MSG_ALLOCATED 0xa5a5#define MSG_SENDED 0x5a5a#define MSG_RECEIVED 0xaa55#define MSG_STATUS_NULL 0x55aa#define MSG_RETURN_DMEM(pMsgHead)\\do{\ if(MSG_SENDED!=pMsgHead->status)\ { \ pMsgHead->status = MSG_STATUS_NULL; \ }\ aos_dmem_free((VOID*)pMsgHead);\}while(0)#define MSG_QUE_SEND( mpe, mb, prio )\\do{\ extern MPS_S *g_pstMpset;\ extern MPE_S *g_pstMpe;\ AOS_ASSERT( mb->data >= mb->head+2*sizeof(U32) );\ *(U32*)mb->head = MSG_SENDED;\ *(U32*)(mb->head + sizeof(U32)) = prio;\ msg_que_tail( &g_pstMpset[g_pstMpe[mpe].mps].msg_que[prio], mb );\ aos_event_post( g_pstMpset[g_pstMpe[mpe].mps].task_id, MSG_SYNC_EVENT );\}while(0)typedef struct msg_head_s{ U32 status; U32 msgPrio; U8 L3Reserved[L3_MSG_HEAD_LEN]; U8 L1Reserved[MAX_L1_RESV_LEN]; U16 EFAddr; U8 L2Reserved[4]; U32 srcProcessorId; U32 srcMpe; U32 dstProcessorId; U32 dstMpe; U32 ulSize; U8 msg[4];}MSG_HEAD_S;typedef struct l3_msg_head{ U32 srcProcessorId; U32 srcMpe; U32 dstProcessorId; U32 dstMpe; U32 ulSize; U8 msg[4];}L3_MSG_HEAD_S;typedef struct mps_s { U16 status; U16 task_prio; S8 name[AOS_NAME_LEN]; U32 task_id; struct msg_blk_que msg_que[MSG_PRIO_BUTT];}MPS_S;typedef struct mpe_s { U16 status; U8 print_flag; U8 msg_handling; S8 name[AOS_NAME_LEN]; U32 mps; U32 message_cnt; MPE_INIT_ROUTINE init; MPE_RUN_ROUTINE run; }MPE_S;extern U32 g_MsgLock;extern MPS_S *g_pstMpset;extern MPE_S *g_pstMpe;U32 ssp_mpe_verify( MPE mpe );U32 ssp_mpe_msg_verify( MPE mpe );U32 ssp_mpe_print_enable( MPE mpe );U32 ssp_mpe_print_disable( MPE mpe );U32 ssp_mpe_print_enable_all( );U32 ssp_mpe_print_disable_all( );U32 ssp_mpe_print_verify( MPE mpe );AOS_INLINE U32 ssp_msg_send( MSG_S *msg, U32 prim );VOID ssp_show_mpe();extern void clear_watch_dog(void);#endif#ifdef __cplusplus}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -