⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mm32main.c

📁 phs 源代码 小灵通协议源代码 phs source code
💻 C
字号:
#ifndef PM_ONPC
#ifdef __cplusplus
extern "C"{
#endif

#include	"phs_def.h"
#include	"mm32.h"
//  #pragma		section area m_data
#include	"l3_ext.h"
#include	"mm32data.h"
#include	"sysdef.h"

#ifdef SIMU_ON_PC
#include <string.h>
#endif

extern MM_SYSWRK	mm_syswork;
//  #pragma		section code mp_code

/*************************************************************************************
FUNCTION: mm_main

DESCRIPTION:
	MM entry point

ARGUMENTS PASSED:
	None.

RETURN VALUE:
	None

Revision History:
                            Modification     Tracking
Author                          Date          Number     Description of Changes
-------------------------   ------------    ----------   ------------------------------
Chen Xiangli					08/06/2003					Initial version.
**************************************************************************************/

#ifdef _ON_SANYO_
U1 mm_main(void)
#else
U1 mm_main(void* mbox)
#endif
{
	U1 	i;
	SYS_STATE_TBL*	pStateTbl;
	U1	sts_dat;
#ifndef _ON_SANYO_
	memcpy ((void *) mm_syswork.in_evt, (const void *)(((EV_BUF_ST *)mbox)->event), sizeof (mm_syswork.in_evt));
#endif
	set_up_b((U1 *)SYS_WORK->out_evt, 0, sizeof(SYS_WORK->out_evt));

	pStateTbl = mm_state_table[Mm_sts];

#ifdef SIMU_ON_PC
     ProtocolTrace(10,"!!!MM main %d %d %d\n",Mm_sts,(U1)IN_PRIEVT->pri_cod,0);
#endif

	switch ( SYS_WORK->in_evt[0] )
	{
	case EMM:
	//This module deals with  the high layer's request or response,
	//such as location registration request , Authentication response
	//and function request.or the timer event form itself
		sts_dat = (U1)IN_PRIEVT->pri_cod;

		#ifdef EXT_IO
			switch (IN_PRIEVT->pri_cod)
			{
			case PRTM301P  :
			case PRTM303P  :
			case PRTM304P  :
				HisOut(0, 0x32, (U1)IN_PRIEVT->pri_cod, 0, 0);
			}
		#endif
	break;

	case EDLDTDSP	:
	case EDLUDTDSP	:
	//This module deals with the message which come from L2,such as
	//location registration response,authentication request
	//and function request response
		sts_dat = (((MM_MSGDAT *)IN_DLDEVT->msg_adr)->dat[1]) & ~BIT8;	//dat[0]:protocol identification
																	//dat[1]:message type
																	//dat[2]:information unit type
	break;

	default 		:
		//Init ,this module deals with initial action
		sts_dat = (U1)SYS_WORK->in_evt[0];/* 餐掭暮澳

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -