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

📄 rtk05pma.hem

📁 这是用Labwindows开发的一个RF test程序。 用于日本机种的组装后ANT 测试。
💻 HEM
字号:
/******************************************************************************/
/* SCCS: %Z% Name: %M% Date US: %G% %U% Ver.: %I% */
/******************************************************************************/
/*F(*************************************************************************** 
 * File name : rtk05pma.hem
 * Project : RTKGENER
 * Module : RTK-E (Real Time Kernel)
 * Date : (US) %G% %U%
 * Version : %I%
 * Compiler name and release(s) :
 *----------------------------------------------------------------------------* 
 *----------------------------------------------------------------------------* 
 *                                    DESCRIPTION
 * Finite State Machine external macros
 *----------------------------------------------------------------------------* 
 *----------------------------------------------------------------------------* 
 *                           FUNCTIONS DEFINED IN THIS FILE
 *----------------------------------------------------------------------------* 
 * Name            | Object
 *----------------------------------------------------------------------------* 
 * 
 *----------------------------------------------------------------------------* 
 *----------------------------------------------------------------------------* 
 *                                    EVOLUTION
 *----------------------------------------------------------------------------* 
 * Date     | Author     | Arnb   | Description
 *----------------------------------------------------------------------------* 
 * 07/07/97 | J.Thomas   | XXYYYY | - Creation from 'SERVICES-RR17.1.18' for rtke
 * ---------+------------+--------+-------------------------------------------*
 * 04/05/00 | J.C.Trotin |        | - Add the macro
 *          |            |        | MC_RTK_GET_CURRENT_PROCESS_IDENTITY
 ***************************************************************************)F*/
/* #*/

#ifndef RTK05PMA_HEM
#define RTK05PMA_HEM

/*=======================================================================*/
/*=======================================================================*/
/*                      DECLARATION OF THE MACRO                         */
/*=======================================================================*/
/*=======================================================================*/

/*------------------------------------------------*/
/* Description of the Final States specifications */
/*------------------------------------------------*/

#define MC_RTK_DFSM( NameOfState ) \
const t_OperationDescriptor NameOfState[] = {

#define MC_RTK_OFSM( OperationType, Transition, NextState ) \
   (const t_OperationDescriptor *((*)(t_RtkObject *)))Transition, NextState, OperationType, MC_PCC_FILL_INISTRUCT2
/* ( t_OperationType *)Transition, NextState, OperationType,*/

#define MC_RTK_MFSM( Address ) \
  (const t_OperationDescriptor *((*)(t_RtkObject *)))Address, NULL, FSM_MEM_OPERATION_TABLE, MC_PCC_FILL_INISTRUCT2

#define MC_RTK_FFSM( ErrorOperation, NextState ) \
 (const t_OperationDescriptor *((*)(t_RtkObject *)))ErrorOperation, NextState, FSM_END_OPERATION_TABLE, MC_PCC_FILL_INISTRUCT2 };

#define MC_RTK_NTAB( NextTable ) \
 (const t_OperationDescriptor *((*)(t_RtkObject *))) NULL, NextTable, FSM_NEXT_OPERATION_TABLE, MC_PCC_FILL_INISTRUCT2 };

/*--------------------------------------*/
/* Declaration of the Memorized Table   */
/*--------------------------------------*/

#define MC_RTK_DEVTM( NameOfMemorizedTable ) \
const t_OperationType NameOfMemorizedTable[] = {

#define MC_RTK_OPMEM( OperationToMemorize ) \
OperationToMemorize,

#define MC_RTK_FEVTM \
FSM_END_OPERATION_TABLE };

/*----------------------------------------------*/
/* Access to the parameters of a message header */
/*----------------------------------------------*/

#define MC_RTK_GET_MSG_LENGTH(MsgPtr)		(((t_MsgHeader *) (MsgPtr))->v_Length)
#define MC_RTK_GET_MSG_TRANSMITTER(MsgPtr)	(((t_MsgHeader *) (MsgPtr))->s_Transmitter)
#define MC_RTK_GET_MSG_RECEIVER(MsgPtr)		(((t_MsgHeader *) (MsgPtr))->s_Receiver)
#define MC_RTK_GET_MSG_OPTYPE(MsgPtr)		(((t_MsgHeader *) (MsgPtr))->v_OperationType)

/*----------------------------------*/
/* Definitions of the routine calls */
/*----------------------------------*/

/***************************************************************************/
/* PROCESS : run for receiving distribute a message to a Process in a task */
/***************************************************************************/
#define MC_RTK_RUN_PROCESS( TaskDescriptor) \
        Rtk05_1RunProcess( TaskDescriptor)

/*****************************************/
/* PROCESS : send a message to a Process */
/*****************************************/
#define MC_RTK_SEND_MSG_TO_PROCESS( TransmitterName,     \
                                    TransmitterInstance, \
                                    ReceiverName,        \
                                    ReceiverInstance,    \
                                    OperationType,       \
                                    Message )            \
        Rtk05_2SendMsgToProcess((((TransmitterInstance) << SHIFT_INST) | ((TransmitterName) << SHIFT_PROC)), \
                                (((ReceiverInstance) << SHIFT_INST) | ((ReceiverName) << SHIFT_PROC)),       \
                                OperationType,                                                             \
                                Message )

/*******************************************************/
/* PROCESS : send a message to a Process with priority */
/*******************************************************/
#define MC_RTK_SEND_MSG_PRIO_TO_PROCESS( TransmitterName,     \
                                         TransmitterInstance, \
                                         ReceiverName,        \
                                         ReceiverInstance,    \
                                         OperationType,       \
                                         Message )            \
        Rtk05_5SendMsgPrioToProcess((((TransmitterInstance) << SHIFT_INST) | ((TransmitterName) << SHIFT_PROC)), \
                                    (((ReceiverInstance) << SHIFT_INST) | ((ReceiverName) << SHIFT_PROC)),       \
                                    OperationType,                                                             \
                                    Message )

/************************************************/
/* PROCESS : send a filled message to a Process */
/************************************************/
#define MC_RTK_SEND_FMSG_TO_PROCESS( Message ) \
        Rtk05_10SendFilledMsgToProcess( Message )

/**************************************************************/
/* PROCESS : send a filled message to a Process with priority */
/**************************************************************/
#define MC_RTK_SEND_FMSG_PRIO_TO_PROCESS( Message ) \
        Rtk05_11SendFilledMsgPrioToProcess( Message )

/************************************************/
/* PROCESS : create a new instance of a Process */
/************************************************/
#define MC_RTK_CREATE_PROCESS_INSTANCE( ProcessName,                    \
                                        AddressFor_InstanceCreated_id ) \
        Rtk05_3CreateProcessInstance( ProcessName,                          \
				      AddressFor_InstanceCreated_id )

/*********************************************/
/* PROCESS : delete an instance of a process */
/*********************************************/
#define MC_RTK_DELETE_PROCESS_INSTANCE( ProcessName, Instance_id ) \
        Rtk05_4DeleteProcessInstance( ProcessName, Instance_id )

/****************************************************************/
/* PROCESS : Get the Instance Id of the current PROCESS running */
/****************************************************************/
#define MC_RTK_SET_PROCESS_INST_USR_DATA( ProcessName,          \
                                               FsmInstance_id,       \
                                               InstanceUserData )    \
        Rtk05_6SetProcessInstanceUserData( ProcessName,       \
				           FsmInstance_id,    \
				           InstanceUserData )

/****************************************************************/
/* PROCESS : Get the Instance Id of the current process running */
/****************************************************************/
#define MC_RTK_GET_PROCESS_INSTANCE( ProcessName, AddressFor_Instance_id ) \
        Rtk05_7GetProcessInstance( ProcessName, AddressFor_Instance_id )

/**********************************************************/
/* PROCESS : Get the precedent state of the current state */
/**********************************************************/
#define MC_RTK_GET_PREC_PROCESS_STATE( ProcessName, AddressFor_PrecedentState ) \
        Rtk05_8GetPrecedentProcessState( ProcessName, AddressFor_PrecedentState )

/***********************************/
/* PROCESS : Get the current state */
/***********************************/
#define MC_RTK_GET_ACTIVE_PROCESS_STATE( ProcessName, AddressFor_ActiveState ) \
        Rtk05_9GetActiveProcessState( ProcessName, AddressFor_ActiveState )

/***********************************************************************************/
/* PROCESS : Get the name and the instance number of the process currently running */
/***********************************************************************************/
#define MC_RTK_GET_CURRENT_PROCESS_IDENTITY( Address_For_Process_Identity ) \
        Rtk05_12GetCurrentProcessIdentity( Address_For_Process_Identity )

/******************************************/
/* PROCESS: Puts the process table in RAM */
/******************************************/
#define MC_RTK_CREATE_RAM_PROCESS_TABLE \
        Rtk06_1CreateRamProcessTable()

/***************************************/
/* PROCESS: Modifies the process table */
/***************************************/
#define MC_RTK_ENABLE_REPLACE_PROCESS { v_Rtk_EnableReplaceProcess = 0; }

#define MC_RTK_DISABLE_REPLACE_PROCESS { v_Rtk_EnableReplaceProcess = 1; }

#define MC_RTK_REPLACE_PROCESS( OldProcess, NewProcess ) \
        Rtk06_2ReplaceProcess( OldProcess, NewProcess )

/***************************************/
/* PROCESS: Modifies the process table */
/***************************************/
#define MC_RTK_PROCESS_MAILBOX_NUMBER(ProcessName) \
	Rtk06_3DetermineTaskNumber(ProcessName)

/****************************************/
/* PROCESS: Manage timers for processes */
/****************************************/
#define MC_RTK_PROCESS_START_TIMER( TimerID, Count ) \
           RtkStartTimer( TimerID,                      \
                          Rtk06_3DetermineTaskNumber(((TimerID) >> SHIFT_TIMER_PROC) & 0xFF), \
                          Count, 0,0 )

#define MC_RTK_PROCESS_START_AR_TIMER( TimerID, Count ) \
           RtkStartTimer( TimerID,                         \
                          Rtk06_3DetermineTaskNumber(((TimerID) >> SHIFT_TIMER_PROC) & 0xFF), \
                          Count, 1,0 )

#define MC_RTK_PROCESS_START_TIMER_WP( TimerID, Count, Precision ) \
           RtkStartTimer( TimerID,                      \
                          Rtk06_3DetermineTaskNumber(((TimerID) >> SHIFT_TIMER_PROC) & 0xFF), \
                          Count, 0, Precision )


#define MC_RTK_PROCESS_START_AR_TIMER_WP( TimerID, Count, Precision ) \
           RtkStartTimer( TimerID,                        \
                          Rtk06_3DetermineTaskNumber(((TimerID) >> SHIFT_TIMER_PROC) & 0xFF), \
                          Count, 1, Precision )

/****************************************/
/* PROCESS: Manage events for processes */
/****************************************/
#define MC_RTK_PROCESS_SET_EVENT( ProcessReceiverName, ReceiverInstance, BitNumber )\
	   RtkSetEvent( Rtk06_3DetermineTaskNumber(ProcessReceiverName), BitNumber ) 

/***********************************************************************/
/* PROCESS : Get the current state of a specified process and instance */
/***********************************************************************/
#define MC_RTK_GET_CURRENT_INSTANCE_STATE( ProcessName, InstanceId, AddressFor_CurrentState ) \
           Rtk05_13GetCurrentInstanceState( ProcessName, InstanceId, AddressFor_CurrentState )


/***************************/
/*  OPERATION  TYPE MACRO  */
/***************************/
#define MC_RTK_PROCESS_TIMER( ProcessName, Instance, Operation ) \
        ( ( (Instance) << SHIFT_TIMER_INST ) \
        | ( (ProcessName) << SHIFT_TIMER_PROC )                         \
        | ( (Operation) << SHIFT_TIMER_OPTY ) )

#endif /* RTK05PMA_HEM */

⌨️ 快捷键说明

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