evt.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- #include <gendef.h>
- #include <stddefs.h>
- #include <stevt.h>
- #include <string.h>
- #include "section.h"
- #include "evt.h"
- /******************************************************************************
- * Local macros
- ******************************************************************************/
- #define EVT_EVT_MAX_NUM 80 /*90*/
- #define EVT_CON_MAX_NUM 30 /*60*/
- #define EVT_SUB_MAX_NUM 60 /*90*/
- /******************************************************************************
- * Local variables
- ******************************************************************************/
- ST_DeviceName_t g_KB_EVTDeviceName[] = {"EVT", "OSD"};
- STEVT_Handle_t g_KB_EVTHandle[KB_EVT_INST];
- ST_ErrorCode_t KB_EVTSetup(void)
- {
- ST_ErrorCode_t ST_ErrorCode;
- STEVT_InitParams_t STEVT_InitParams;
- STEVT_OpenParams_t STEVT_OpenParams;
- int Instance;
- memset(&STEVT_InitParams, ' ', sizeof( STEVT_InitParams_t ) );
- memset(&STEVT_OpenParams, ' ', sizeof( STEVT_OpenParams_t ) );
- for(Instance = 0; Instance < KB_EVT_INST; Instance++ )
- {
- STEVT_InitParams.EventMaxNum = EVT_EVT_MAX_NUM;
- STEVT_InitParams.ConnectMaxNum = EVT_CON_MAX_NUM;
- STEVT_InitParams.SubscrMaxNum = EVT_SUB_MAX_NUM;
- STEVT_InitParams.MemoryPartition = SystemPartition;
- Print("nKB_EVTSetup(%s)=", g_KB_EVTDeviceName[Instance] );
- ST_ErrorCode = STEVT_Init(g_KB_EVTDeviceName[Instance], &STEVT_InitParams);
- if (ST_ErrorCode != ST_NO_ERROR)
- {
- Print("STEVT_Init Errorn" );
- return( ST_ErrorCode );
- }
- Print("%sn", STEVT_GetRevision());
- #if 1
- Print("EVT_Open=");
- ST_ErrorCode = STEVT_Open(g_KB_EVTDeviceName[Instance], &STEVT_OpenParams, &g_KB_EVTHandle[Instance] );
- if (ST_ErrorCode != ST_NO_ERROR)
- {
- Print("STEVT_Open Errorn");
- return( ST_ErrorCode );
- }
- Print("g_KB_EVTHandle[%d] = %xn", Instance, g_KB_EVTHandle[Instance]);
- #endif
- } /* for(Instance) ;) */
- return( ST_ErrorCode );
- }
- /* EOF */